Print Page | Close Window

Printing syntax edit text

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=9913
Printed Date: 24 November 2024 at 5:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Printing syntax edit text
Posted By: Neil
Subject: Printing syntax edit text
Date 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)?



Replies:
Posted By: AndreiM
Date Posted: 18 March 2008 at 4:07am
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.


-------------
Regards,
Andrei Melnik


Posted By: Neil
Date Posted: 18 March 2008 at 7:41am
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


Posted By: Neil
Date Posted: 18 March 2008 at 7:47am
Hi Andrei,

Is there a PrintText method also, that allows me to print without displaying the printer dialog box ?


Posted By: AndreiM
Date Posted: 18 March 2008 at 8:37am
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


-------------
Regards,
Andrei Melnik


Posted By: Neil
Date Posted: 18 March 2008 at 1:43pm
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


Posted By: SuperMario
Date Posted: 18 March 2008 at 3:39pm
Originally posted by Neil Neil wrote:

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


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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net