Products Technologies Demo Docs Blog Support Company

Replace TextControl: Using ServerTextControl for Non-UI Background Tasks

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…

Replace TextControl: Using ServerTextControl for Non-UI Background Tasks

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

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

Windows FormsGetting StartedTutorial

Windows Forms Tutorial: Create Your First Windows Forms C# Application

This tutorial shows how to create your first Windows Forms application with C# using TX Text Control .NET for Windows Forms in Visual Studio 2022.


ASP.NETASP.NET CoreMailMerge

How to Mail Merge MS Word DOCX Documents in ASP.NET Core C#

Mail merge is the process of merging data, such as Json or IEnumerable objects, into a template document, such as a DOC or DOCX file. This tutorial is a walkthrough of the steps necessary to…


AngularDocument EditorNode.js

Creating an Angular Document Editor Application with a Node.js WebSocket Server

This tutorial shows how to create an Angular application that uses the Document Editor with a Node.js WebSocket server.


ASP.NETASP.NET CoreMailMerge

Adding SVG Watermarks to Documents

This article shows how to add SVG images to document section headers that repeat automatically on each page. This watermark will be inserted vertically and horizontally centered on each section page.


ASP.NETASP.NET CoreMailMerge

Using MailMerge in ASP.NET Core 6 Web Applications

This article shows how to use the TX Text Control ASP.NET MailMerge class to merge templates with JSON data within a .NET 6 application in Visual Studio 2022.