Well, I figured out how to print from the Rich Text Control. Then discovered that it was not powerful enough for our needs. But, in case it is what you want, here is how we finally got it to work....
--------------
* Print Rich Text from the Rich Text Control.
* The trick to this routine is creating your own device context
* rather than using the one already defined.
PRIVATE lnhDC
* Register API functions to get a device context
DECLARE LONG CreateDC IN GDI32 ;
STRING, STRING, STRING, CHAR
DECLARE LONG DeleteDC IN GDI32 LONG
* Get a device context for the current printer
lnHDC = CreateDC("", SET("PRINTER",2), .NULL.)
* Use the printer device context just created to print the information
* in your Rich Text Control.
* NOTE: The Rich Text Control name can be anything. We just
* called it "RichTextBox1" for testing purposes
Thisform.RichTextBox1.SelPrint(lnhDC)
* Now remove the printer device context.
DeleteDC(lnhDC)
---------------
>>I am trying to print a Rich Text document from within Foxpro, as well as display the document. I started by using the RichText ActiveX Control, which displays the document with no problem. Now I want to print the document but I need the printer handle to do it using this control. Anybody know how to get a printer handle? Or...does anyone know of a better way to print an RTF within Foxpro?
>
>Hi Eugene,
>
>If you find out an answer to your question, please let me also know about it...
>We're facing the same challenge over here and the only way we had discovered to do that is using the RichText Control Method called "SelPrint" (but that's not enough for us here).
>
>Thanks,
>
>Renato.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement