The class TXTextControl.TextControl is inherited from System.Windows.Forms.Control and must be visible on a form. But often, there are tasks where no UI is required. For example, if a document is pre-merged with data in the background and visible to the end-user when this process is done.

For this purpose, TX Text Control provides the non-UI class TXTextControl.ServerTextControl that is inherited from System.ComponentModel.Component. ServerTextControl can be used for all processes in the background where no UI is required. If you need to prepare a document programmatically before it is displayed to the end-user, you can use an instance of TXTextControl.ServerTextControl to create the document with the same API just like with the Windows Forms control TXTextControl.TextControl.

There are several advantages of ServerTextControl such as:

  • Better performance
  • Multi-threading support
  • Non-UI (must not be visible on a form)
  • Smaller memory footprint (no history for undo/redo, no image rendering)

In order to use the ServerTextControl, you'll need to add a reference to the TXTextControl.Server.dll and an entry in the licenses.licx file:

TXTextControl.ServerTextControl, TXTextControl.Server, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638

The following code shows how to create an instance of ServerTextControl. An using statement is recommended as the object must be disposed explicitly.

using (TXTextControl.ServerTextControl serverTextControl1
    = new TXTextControl.ServerTextControl())
    {
        serverTextControl1.Create();
        ...
    }

The Text Control Reporting engine MailMerge can be also connected to a non-UI ServerTextControl to create reports in the background in multi-threaded environments.

The latest version X10 (20.0) supports the usage of this component with the client-license of TX Text Control. Try it yourself and give your background processes a boost:

Download a fully featured, 30 day trial version