Printing in TX Text Control 
Author Message
 Printing in TX Text Control

Hi!

I've been testing the 'TX Text Contol' ActiveX Control  in VFP and everthing
seems to work ok except that I just can't get it to Print. The Help File
only has examples in VB. Can anyone help me get it working?

Thanks
Terry



Sat, 11 Dec 2004 05:50:27 GMT  
 Printing in TX Text Control
Who makes the control? What the heck is it?

Post the VB example, and someone will be able to translate, or teach you
how.

Dan


Quote:
> Hi!

> I've been testing the 'TX Text Contol' ActiveX Control  in VFP and
everthing
> seems to work ok except that I just can't get it to Print. The Help File
> only has examples in VB. Can anyone help me get it working?

> Thanks
> Terry



Sat, 11 Dec 2004 06:54:38 GMT  
 Printing in TX Text Control
If you dont get an answer then the TX text control has a foxpro support
person, or did have
Allen


Quote:
> Hi!

> I've been testing the 'TX Text Contol' ActiveX Control  in VFP and
everthing
> seems to work ok except that I just can't get it to Print. The Help File
> only has examples in VB. Can anyone help me get it working?

> Thanks
> Terry



Sat, 11 Dec 2004 08:06:43 GMT  
 Printing in TX Text Control
Hi Dan!

TX Text Control, the text processor in a single ActiveX control. Using Text
Control, you can create all kinds of text-based applications with the ease
of programming that is characteristic of Visual Basic and with highly
sophisticated formatting and display capabilities which are normally the
exlusive domain of large word processing packages.

Copyright ? 1991-2002 The Imaging Source Europe GmbH.

 http://www.textcontrol.com

Example of Printing in VB

Sub mnuFile_Print_Click ()
   Dim wPages As Integer, No As Integer
   wPages = TXTextControl1.CurrentPages
   For No = 1 To wPages
      Printer.Print
      TXTextControl1.PrintDevice = Printer.hDC
      TXTextControl1.PrintPage No
      Printer.NewPage
   Next No
   Printer.EndDoc
End Sub

I tried to use CommonDialog to get a 'hDC' becaus VFP doesn't have Printer
Command like the one above.
Any  help would be appreciated.

Thanks
Terry



Quote:
> Who makes the control? What the heck is it?

> Post the VB example, and someone will be able to translate, or teach you
> how.

> Dan



> > Hi!

> > I've been testing the 'TX Text Contol' ActiveX Control  in VFP and
> everthing
> > seems to work ok except that I just can't get it to Print. The Help File
> > only has examples in VB. Can anyone help me get it working?

> > Thanks
> > Terry



Sat, 11 Dec 2004 13:27:03 GMT  
 Printing in TX Text Control
You've answered your own question. <g> VFP doesn't have the equivalent of
VB's printer object.

Most of VB's exposed objects are nothing but wrappers around the equivalent
Windows API object, of course. I'm not enough of an API programmer to even
begin to guess how to unravel this, but if you can figure out what API calls
VB is making you can make those same calls from VFP.

Dan


Quote:
> Hi Dan!

> TX Text Control, the text processor in a single ActiveX control. Using
Text
> Control, you can create all kinds of text-based applications with the ease
> of programming that is characteristic of Visual Basic and with highly
> sophisticated formatting and display capabilities which are normally the
> exlusive domain of large word processing packages.

> Copyright ? 1991-2002 The Imaging Source Europe GmbH.

>  http://www.textcontrol.com

> Example of Printing in VB

> Sub mnuFile_Print_Click ()
>    Dim wPages As Integer, No As Integer
>    wPages = TXTextControl1.CurrentPages
>    For No = 1 To wPages
>       Printer.Print
>       TXTextControl1.PrintDevice = Printer.hDC
>       TXTextControl1.PrintPage No
>       Printer.NewPage
>    Next No
>    Printer.EndDoc
> End Sub

> I tried to use CommonDialog to get a 'hDC' becaus VFP doesn't have Printer
> Command like the one above.
> Any  help would be appreciated.

> Thanks
> Terry



> > Who makes the control? What the heck is it?

> > Post the VB example, and someone will be able to translate, or teach you
> > how.

> > Dan



> > > Hi!

> > > I've been testing the 'TX Text Contol' ActiveX Control  in VFP and
> > everthing
> > > seems to work ok except that I just can't get it to Print. The Help
File
> > > only has examples in VB. Can anyone help me get it working?

> > > Thanks
> > > Terry



Sun, 12 Dec 2004 01:03:41 GMT  
 Printing in TX Text Control
tx does not have a foxpro support person that I am aware of and it does not
even integrate properly with VFP but I do use it.  I have gotten it to print
rich text with the common dialog but it does have some drawbacks.  First, you
can specify a starting and ending page in the properties. Second, it does not
always assign an hdc and then you have to try and print again.  I'm still
looking for a control that will work properly but this is better than nothing.
Mike


Tue, 14 Dec 2004 11:56:20 GMT  
 Printing in TX Text Control
Take a look at my rtfprinter classes, especially the APIprinter class. This
provides simple standard Windows printing functionality in VFP for controls
which requires an hDC (startdoc, startpage, endpage, enddoc).
www.cochrane.dk/downloads/rtfprinter.zip
Rasmus


Quote:
> Hi!

> I've been testing the 'TX Text Contol' ActiveX Control  in VFP and
everthing
> seems to work ok except that I just can't get it to Print. The Help File
> only has examples in VB. Can anyone help me get it working?

> Thanks
> Terry



Tue, 14 Dec 2004 15:05:58 GMT  
 Printing in TX Text Control
Thankyou everyone for your help.

In the mean time I have a solution that works quite well and am listing it
here incase anyone else has the same problem

Thanks again Terry

*-- Begin Code --*
Local lcOrientation,  lnPages,  lnPrint

Declare Integer StartDoc In Win32Api Integer, String
Declare Integer StartPage In Win32Api Integer
Declare Integer EndPage In Win32Api Integer
Declare Integer EndDoc In Win32Api Integer
Declare Integer CreateDC In Win32Api String, String, Integer, Integer
Declare Integer DeleteDC In Win32Api Integer

lcOrientation = "P" && Paper orientation

With Thisform
  ._CommonDialog1.Flags = cdlPDDisablePrintToFile + ;
                                            cdlPDNoPageNums + ;
                                            cdlPDNoSelection + ;
                                            cdlPDReturnDC
  ._CommonDialog1.PrinterDefault = .F.
  If lcOrientation == "P"
    ._CommonDialog1.Orientation = 1
  Else
    ._CommonDialog1.Orientation = 2
  Endif
  ._CommonDialog1.ShowPrinter
  If ._CommonDialog1.hDC > 0
    StartDoc(._CommonDialog1.hDC, Chr(20) + Replicate(Chr(0),19))
    lnPages = ._TXTextControl1.CurrentPages
    For lnPrint = 1 To lnPages
      StartPage(._CommonDialog1.hDC)
      ._TXTextControl1.PrintDevice = ._CommonDialog1.hDC
      ._TXTextControl1.PrintPage(lnPrint)
      EndPage(._CommonDialog1.hDC)
    Endfor
    EndDoc(._CommonDialog1.hDC)
    DeleteDC(._CommonDialog1.hDC)
  EndIf
EndWith

Return
*-- End Code --*



Quote:
> Hi!

> I've been testing the 'TX Text Contol' ActiveX Control  in VFP and
everthing
> seems to work ok except that I just can't get it to Print. The Help File
> only has examples in VB. Can anyone help me get it working?

> Thanks
> Terry



Tue, 14 Dec 2004 16:07:27 GMT  
 Printing in TX Text Control
They told me they did a while back. Sorry if its now wrong
Allen


Quote:
> tx does not have a foxpro support person that I am aware of



Wed, 15 Dec 2004 21:03:08 GMT  
 Printing in TX Text Control
Terrance,

your method does not provide for a good solution although it is the best that I
know of so far.  First, the commondialog has the page numbers from/to grayed
out so you cannot select a range.  Second, it does not work properly with many
new printers on the market.  There seems to be an incompatibility with the
printer drivers.  So, I'm not sure what the solution is at the present time.

Mike



Sat, 18 Dec 2004 12:14:50 GMT  
 Printing in TX Text Control
I've played with this one also and although it's somewhat cryptic I'm not sure
that it will work either.  It appears to use the richtx20 format and not
richtx32 so I don't know that it will use the extended rich text set including
tables, page breaks, etc.  But, I'll have to delve into it further to be sure -
perhaps someone can save me the time if they have already checked into this.

Quote:
>Subject: Re: Printing in TX Text Control

>Date: 6/28/2002 12:05 AM Pacific Daylight Time

>Take a look at my rtfprinter classes, especially the APIprinter class. This
>provides simple standard Windows printing functionality in VFP for controls
>which requires an hDC (startdoc, startpage, endpage, enddoc).
>www.cochrane.dk/downloads/rtfprinter.zip
>Rasmus

Mike


Sat, 18 Dec 2004 12:18:07 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Rich Text Controls -- TX Control vs AllText

2. HELP! TX Text Control

3. ANN: New TX Text Control / VisualWriter Web Site

4. TX Control - active x controls

5. TX Control - active x controls

6. TX Text, Checkmate, and Visual FoxPro; Quark Conversion

7. NEED Help to print contents of a RTF-Control in VFP5 (Rich-Text.ocx)

8. Rich Text Control I can print

9. TX Control & Page Numbering

10. TX ActiveX Control

11. Inheritance, ActiveX, and the TX Control

12. Controlling text in tooltip text

 

 
Powered by phpBB® Forum Software