This message contains graphics. If you do not see the graphics: Graphic Version.
 
SP2 for TX 10.1 released, TX .NET with ComponentOne's Print Preview

SP2 for TX Text Control .NET for Windows Forms and ActiveX 10.1 released

Service Pack 2 for TX Text Control .NET for Windows Forms 10.1 and Service Pack 2 for TX Text Control ActiveX 10.1 have just been released. If you are experiencing any of the issues listed in the known issues list, please install the service pack.

  1. Please take a look at the updated known issues list.
  2. You can download the service pack.
  3. As ever, our support team is waiting to answer your questions. Full contact details here.

Using TX Text Control .NET for Windows Forms with Component One's Print Preview

This week we would like to show you another .NET component that works well with the TX Text Control .NET for Windows Forms. The ComponentOne Preview .NET component offers some advantages over the standard VS .NET print preview.

ComponentOne's control comes with the C1PrintPreview component and the C1PrintDocument component. In this sample, we are going to use the preview component only.

Using the components together is quite straight-forward: You need to create a custom PrintController, so that TX Text Control does not send its contents to the standard printer. The dummy PrintController does not do anything except return a Graphics object in the OnStartPage handler. As you cannot create a Graphics object without a Form or a Screen object, a reference to the parent form has to be set with the SetParent method.

Private Class MyPrintController Inherits System.Drawing.Printing.PrintController Private parent As Form1 Public Sub New() MyBase.New() End Sub Public Sub SetParent(ByVal form As Form1) parent = form End Sub Public Overloads Overrides Function OnStartPage(ByVal document_ As System.Drawing.Printing.PrintDocument, ByVal e As System._ Drawing.Printing.PrintPageEventArgs) As System.Drawing.Graphics OnStartPage = parent.CreateGraphics() End Function Public Overloads Overrides Sub OnEndPage(ByVal document As_ System.Drawing.Printing.PrintDocument, ByVal e As System.Drawing._ Printing.PrintPageEventArgs) End Sub Public Overloads Overrides Sub OnEndPrint(ByVal document As_ System.Drawing.Printing.PrintDocument, ByVal e As System.Drawing._ Printing.PrintEventArgs) End Sub Public Overloads Overrides Sub OnStartPrint(ByVal document As_ System.Drawing.Printing.PrintDocument, ByVal e As System.Drawing._ Printing.PrintEventArgs) End Sub

The CreateGraphics method of this reference can be used in the OnStartPage event handler. Have a look at the code to see how it works.

Note that at least TX Text Control .NET for Windows Forms 10.1 trial, a trial version of ComponentOne Preview .NET and Visual Studio VB .NET are required to run this sample.


Best regards

The Newsletter Team

Text Control GmbH respects your online time and privacy. We only send this newsletter to TX Text Control customers and people who have signed up to receive it. However, if you would prefer not to receive future issues of the newsletter, you may unsubscribe at any time. If you received this newsletter forwarded from a colleague or friend, you may wish to subscribe directly.

Sent to: N/A.

Imprint | Unsubscribe | Subscribe

© 2019 Text Control GmbH. All Rights Reserved.