Printing syntax edit text |
Post Reply |
Author | |
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
Posted: 17 March 2008 at 1:45pm |
The Syntax edit sample has the section of code that prints the contents of the control commented out. Looking at the code, it looks like the text in the control is pasted into a hidden richtext control, and then the richtext control is used to send the text to the printer.
I would like to test if this is the way to print (why was it commented out in the sample anyway?). In order to use the richtext control in the way I described above, I need to be able to select all the text in the SyntaxEdit control and paste them into the richtext conmtrol, however, the SyntaxEdit control does not exposes methods/propertes that allows programatically selecting all of its text into the clipboard (along with formatting info). Does anyone know how to print the contents of the SyntaxEdit control (along with the syntax highlighting colors)? |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
The syntax edit does not use RichEdit (no other controls).
To print text just call
wndSyntaxEdit.PrintText2 True
See PrintOptions to customize printing.
The commented out code shows how to print to the devive context by its handle (HDC).
The PrintText2 method show you dialog to select printer or print to the default printer.
The commented out code also shows how you can select pinter yourself.
|
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hi Andrei,
I cannot find the PrintText2 method on the SyntaxEdit control (I am using v11.2.0). I have also searched the online documentation , but cannot find that method in the help file either - could you please provide further info? thanks |
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hi Andrei,
Is there a PrintText method also, that allows me to print without displaying the printer dialog box ? |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
Hi,
Please use the latest version (11.2.2). The Printing added since 11.2.1.
See the folowing method and properties.
PrintText(OLE_HANDLE lHDC) PrintText2(VARIANT_BOOL bShowPrintDialog) PrintPreview(VARIANT_BOOL ShowPrintDialog) PrintOptions
PrintPreviewOptions |
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hi Andrei,
How do I get a copy of 11.2.2?. Is it a free upgrade?. I only bought version 11.2.0 a few months ago. Please respond ASAP. Thanks |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
It depends on whether you purchased a 1 year maintenance subscription, if you bought a couple months ago then your 30 days would have expired. I suggest you contact sales. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |