TX Text Control .NET for Windows Forms

GitHub Examples

Topic

Text Control publishes the sample applications of TX Text Control .NET for Windows Forms on GitHub, in the organization TextControl: the official samples that the setup also installs, and the projects behind articles of the Text Control Blog. Most of them were written for an earlier version, so knowing how a sample references TX Text Control, and what to change, saves time when you run one for the first time.

What the Organization Contains

  • The sample index. TXSamples.NET lists the official sample repositories of all .NET products of Text Control.
  • The official Windows Forms samples. TXSamples_WinForms_CSharp and TXSamples_WinForms_VB.NET contain 18 sample applications in three categories, each once for the .NET Framework 4.8 (folder .NET-Framework-48) and once for .NET 6 (folder .NET-Core-6):
    • Tutorial: a form with a TextControl, a ribbon with five tabs, two ruler bars and a status bar.
    • Howto: charts, hyperlinks, mail merge, the mini toolbar, spreadsheet formulas in tables and XML files.
    • TX Words: the word processor sample and the samples built on it; see TX Words Sample Application.
  • Blog samples. Many articles of the Text Control Blog come with a repository. Their names start with TextControl.WindowsForms., TextControl.Windows.Forms., TXTextControl.Windows.Forms. or TextControl., and most are small projects in C# for the .NET Framework.
  • Other products. The organization also contains samples for TX Text Control .NET for WPF, TX Text Control .NET Server, TX Spell .NET and DS Server. The examples pages of this section list only samples you can use in Windows Forms.
  • Agent Skills. The repositories txtextcontrol-document-editor-skills and txtextcontrol-servertextcontrol-skills hold skills for AI coding assistants, written for the Document Editor and ServerTextControl of TX Text Control .NET Server. AI Coding Assistants explains what they cover and how to connect an assistant to the Text Control MCP Server.

The blog article Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub introduced the official repositories.

Run a Sample

You need Visual Studio and TX Text Control .NET for Windows Forms: the setup of the full or the trial version provides the assemblies, the NuGet package and the license. See Installing the Product.

Clone the repository and open the project or solution file of a sample in Visual Studio. The official samples have no solution file; each sample is a project in its own folder:

git clone https://github.com/TextControl/TXSamples_WinForms_CSharp.git

None of the repositories contains a nuget.config file. Projects for .NET get the package TXTextControl.TextControl.WinForms.SDK from the package source Text Control Offline Packages that the setup adds, as Configuring Package Sources describes. Update a sample before you build it, as described below.

Update an Older Sample

The official samples on GitHub were last updated for version 32.0, and the blog samples reference versions from 31.0 to 34.0. The setup installs the samples of the current version; for those on GitHub, a few changes are needed.

.NET Samples

The projects in .NET-Core-6 target net6.0-windows and reference TXTextControl.TextControl.WinForms.SDK in version 32.0.*. A few blog samples target .NET 8 with version 33.0.0. The package of version 34.0 requires .NET 8 or higher.

  1. Change the target framework in the .csproj file to net8.0-windows or higher.
  2. Update TXTextControl.TextControl.WinForms.SDK to the current version, 34.0.5. See Installing and Updating Packages.
  3. Delete Properties\licenses.licx and the line of the .csproj file that embeds it, if the project has one. Since Service Pack 2 of version 32.0, .NET projects no longer use licenses.licx: the package adds the license file txtextcontrol.winforms.license. See Development Licenses.

.NET Framework Samples

The projects in .NET-Framework-48 and most blog samples reference the assemblies TXTextControl.dll and TXTextControl.Windows.Forms.dll of one version, many also further TX Text Control assemblies such as TXDrawing.dll, TXBarcode.dll and TXDocumentServer.dll. Some blog samples reference them with a path to the installation directory of that version.

  1. Remove the references to the TX Text Control assemblies and add them again from the Assembly folder of your installation.
  2. In Properties\licenses.licx, change the version in each entry to the version of the new assemblies.
  3. Rebuild the project.

Upgrade a .NET Framework Project describes these steps in detail, and Migrating from .NET Framework to .NET moves a sample to .NET 8. The blog article Upgrading a .NET Framework Windows Forms App to a .NET 8 Windows Forms App with TX Text Control 32.0 SP2 walks through such a move.

Where to Start

ExampleWhat it showsWhere
Official samples in C#The tutorial, the how-to samples and the TX Words samples for the .NET Framework 4.8 and .NET 6. Version 32.0TXSamples_WinForms_CSharp
Official samples in Visual BasicThe same samples in Visual Basic. Version 32.0TXSamples_WinForms_VB.NET
Sample indexThe official sample repositories of all .NET productsTXSamples.NET

The blog samples are listed by topic on the pages below.

Samples by Topic

Next Steps