|
Hi all
Does anyone know how to implement something along the lines of the "page preview" mode in word, in either vb6 or .net?
I have googled everywhere to no avail, other than finding highly expensive controls that are way too complicated for my purposes to justify the cost.
All I need is simple richtext editing facilities that the richtextbox already provides, but to display it in the "page" view that word can.
Thanks for your comments.
null
|
|
|
|
|
You'll either have to re-write the RichTextBox control yourself or go with a 3rd party control. The RichTextBox class doesn't support the kind of "page" view your talking about.
[EDIT]
I should have clarified that this will be a large undertaking. The RTB does a half way decent job of editing, but not with the margins and page break support your looking for. I don't even know where your going to begin. This is something where you'll have to try a couple ideas first to see what's going to work and what's not. Kind of Proof-Of-Concept testing...
You'll need to integrate the rendering of margins as specified by PrinterSettings. You'll also need to get the page size, convert all the measurements into display units, handle ALL control rendering, editing, RTF rendering, ...
Come to think about it, that's why the 3rd party controls are so expensive. Too much is invested in research and development making the very component you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Im not worried about the printersettings. Thats something I can already do. Im just scratching my head as to how you get a scrolling page view! lol. I've previously played with pictureboxes as containers etc, just wondered if there was a known avenue to pursue.
|
|
|
|
|
I am developping com addins for word.
I want to find out if there is a way to click
on the customized button in toolbar programmatically.
I tried to call like this in module.
Application.CommandBars("MYWORDTOOLBAR_NAME").FindControl("MYBUTTON").execute
but I am just getting this error message
"fail method "Execute" of object CommandBarButton"
Do you have any idea why?
van
|
|
|
|
|
You might want to break that statement up and see if .FindControl("MYBUTTON") actually returned a CommandBarButton before you try and call .Execute() on it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey,
I have a file path, and from this i want to select a printer on the client by using its name (PDF Printer) and choose to print the file. When the printer is passed a file to print it opens a 'Save File As' dialog box where you choose the save destination and file name of the PDF.
I need a way to specify the destination path and filename of the PDF to be saved and to be able to hide this 'Save File As' dialog box so the user never sees it.
I am using CutePDF Writer and there is a code sample to help here[^]
But i am unable to have any luck
Can anybody help with any hints or suggestions
Thanks you for your time
Chris
|
|
|
|
|
What do you mean by "not having any luck"? What's happening? What's not happening?
What does your code look like? Are you typing the Registry path names and values names EXACTLY as shown?
Normally, you would go to the products support site for assistance with the component. CodeProject deals with the languages themselves, not 3rd party components...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hey,
i was typing it as shown. i dont have much experience of registry values.
First of is all is it possible to make the 'save as' dialog not show and pass information and key presses to it?
Cheers
Chris
|
|
|
|
|
No, you can't prevent it from happening unless the driver exposes any interface to do so. It looks like the only interface supplied by the manufacter of the .PDF Printer Driver is the registry hack. If it doesn't work, then your best bet is to either contact the manufacturer for support on the component (and possibly an update) or find another component that has the (working) functionality you need.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi!! i have used WinInet APIs to work with FTP sessions in VB6. No i'm thinking of writing the same in VB.NET. i'm not able to find a suitable namespace to work with the same WinInet API. What namespace can i use and whats the way i tackle this. i don wanna use any third party components ans wanna write a class of my own. pls suggest
Thankz in advance
|
|
|
|
|
System.Net
System.Net.Sockets
FTP is just a socket application using a pre-determined format of messages, usually on port 21.
|
|
|
|
|
|
There is also a namespace for FTP in the Visual Studio 2005
|
|
|
|
|
How to access a File Transfer Protocol site by using Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;832679
|
|
|
|
|
Hi,
Does anyone know how to make a "CommonDialog", in particular the "SaveFileDialog" always be on top? Like setting the "TopMost" property of a form to true. I want the file dialog to appear on top of all running applications.
Best regards /Emily
|
|
|
|
|
Use the property .ShowDialog() this makes the dialog application modal and will always be on top of your app. But you could make it System modal and then it will be the top most cos the dialog will have to be closed before the system is aloud to be used once more.
HTH
Chris
|
|
|
|
|
Hi,
Thanks for your answear!
I already use the property .ShowDialog(). But I want the file dialog not only to be on top of my app, but also on top of all other app's like with the TopMost property. Is that "System modal"? How do I make it "System modal"?
/Emily
|
|
|
|
|
Hey
i am not to sure how to make a form or dialog system modal but i did find this[^] article. Perhaps using the Win32 API?
Have you tried making a custom save dialog box using a new form and possibly set that forms property to top most. There are tutorials out there to make your own save dialog box.
HTH
Chris
|
|
|
|
|
Hi,
Thanks again.
I have not tried to make my own save dialog box, I migt have to do that if I do not find another solution.
By the way, I'm writing the application in VB.Net if that makes any difference.
Maybe I should look at the Win32 API but it would be nice to avoid using it from my .Net app.
/Emily
|
|
|
|
|
I have two text fields:
StartTime = 20:00:00
and EndTime = 24:00:00
I am trying to check if the current time is between these two times.
I have tried:
if (StartTime.ToString() < CurrentTime) And
(CurrentTime < EndTIme.ToString()) then
'Do Something
end if
But when i go to the immediate window:
?StartTime.ToString()
returns
"System.Windows.Forms.TextBox, Text: 20:00:00"
How do I simply compare StartTime and CurrentTime?
Thanks for your help...
nju0843
|
|
|
|
|
DateTime.Compare Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDateTimeClassCompareTopic.asp
|
|
|
|
|
Nick Ueda wrote:
But when i go to the immediate window:
?StartTime.ToString()
returns
"System.Windows.Forms.TextBox, Text: 20:00:00"
You answered this yourself:
Nick Ueda wrote:
I have two text fields:
StartTime = 20:00:00
and EndTime = 24:00:00
If you want the text in the text field read the Text property:
string startTime = StartTime.Text;
|
|
|
|
|
i want to make a button on my form which will select all items in a listbox (and another button to deselect all). im not sure how to do this. also, i would like to do it with a for.. each loop, as im new to them..
not sure how to, in code, set the selecteditems (or whatever the property is, not sure which one to use).
Dim item As String
For Each item In ListBox1.Items
ListBox1.SelectedItem = ListBox1.Items.IndexOf(item)
Next is as far as iv got, but it doesnt seem to do anything.. any help appreciated
------------------------
Jordan.
III
|
|
|
|
|
First, ensure that your listbox's SelectionMode property is set to MultiSimple or MultiExtended.
Next, ListBox has a method named SetSelected which is called with 2 arguments (index and boolean "Selected")
So to select all items you could use this code:
<br />
for(int i=0;i<ListBox1.Items.Count;i++)<br />
{<br />
ListBox1.SetSelected(i,true);<br />
}<br />
|
|
|
|
|
thanks alot!
is there a way to do this with a for..each loop? using the collection of items in the listbox?
thanks again
------------------------
Jordan.
III
|
|
|
|