Create Your First Windows Forms Application
You build a word processor in a Windows Forms application: a new .NET project, the TX Text Control NuGet package, and a TextControl with a ribbon, rulers and a status bar that the designer adds for you. No code is needed until the last step, which loads a document when the form opens.
Prerequisites
- Visual Studio on Windows. Version 34.0 has been tested with Visual Studio 2026. See Visual Studio.
- The setup of TX Text Control .NET for Windows Forms 34.0, the full or the trial version, installed on your machine. It provides the package source Text Control Offline Packages and the designers. See Installing the Product.
Create the Project
Open Visual Studio and create a new project.
Select C# from the Languages list, Windows from the Platform list and Desktop as the Project Type. The steps in the designer are the same for a Visual Basic project, which you get by selecting Visual Basic instead; the code later on this page is C#.
Select the project template Windows Forms App and click Next.

Enter a project name and click Next.
Select .NET 8 or higher as the Framework, for example .NET 10, and click Create.

The template Windows Forms App (.NET Framework) creates a .NET Framework project instead, which Create a .NET Framework Application covers.
Install the NuGet Package
Select the project in Solution Explorer and choose Project > Manage NuGet Packages....
Select Text Control Offline Packages in the Package source list and click Browse.
Select
TXTextControl.TextControl.WinForms.SDKand click Install.
The package contains the controls, the document engine and your license. See Package Overview for what it adds to the project.
Add the Editor to the Form
Open Form1 in the designer from Solution Explorer.
In the Toolbox, open the tab TX Text Control 34.0, select TextControl and draw the control onto the form.

Click the smart tag in the upper right corner of the
TextControl. In the Wizards group, click Add a Ribbon, Add a StatusBar, Add a Ruler and Add a Vertical Ruler.
Click Arrange Controls Automatically. The controls are now connected to the
TextControland docked so that they fill the form.
Add the Ribbon Tabs
Select the ribbon by clicking its blue File tab title.
Click the smart tag in the upper right corner of the ribbon.
Click Add a RibbonFormattingTab, Add a RibbonInsertTab, Add a RibbonPageLayoutTab, Add a RibbonViewTab and Add a RibbonProofingTab.

Each tab is a ready-made set of commands for the editor. Built-in Ribbon Tabs describes all predefined tabs.
Run the Application
Press F5. The form shows a word processor:
- The ribbon with the File tab and the tabs Home, Insert, Page Layout, View and Proofing. Home contains the groups Clipboard, Font, Paragraph, Styles and Editing.
- A horizontal and a vertical ruler, which show and set margins, indents and tabs.
- The document in page view, starting with the name of the control, textControl1.
- A status bar with the page, line and column of the input position, the language and a zoom slider.

Type some text, format it with the ribbon and resize the form: the editor and its bars follow.
Load a Document When the Form Opens
The following code in Form1.cs shows pages like a printed document and loads a DOCX file when the form opens:
using System;
using System.Windows.Forms;
using TXTextControl;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Load += Form1_Load;
}
private void Form1_Load(object sender, EventArgs e)
{
// Show pages like a printed document
textControl1.ViewMode = ViewMode.PageView;
// Replace the contents with a DOCX file
textControl1.Load("document.docx", StreamType.WordprocessingML);
}
}
Keep the namespace that Visual Studio created around the class. Copy a file named document.docx into the output folder of the project, such as bin\Debug\net10.0-windows, or use its full path.
The code works as follows:
Troubleshooting
- The tab TX Text Control 34.0 is missing. In a .NET project, the tab appears after the package is installed and a form is open in the designer. The setup has to be installed for the designers to work. See Visual Studio Toolbox and Designer.
- Text Control Offline Packages is not in the Package source list. See Configuring Package Sources.
- License questions. In a .NET project, the package brings the license, and nothing else is needed. See Development Licenses.
Next Steps
- Load and Save Documents: open and save documents with and without dialog boxes.
- Create a Ribbon Application with Sidebar Support: add sidebars and a RibbonForm.
- Add Rulers, Toolbars, and a Status Bar: build the editor with a classic button bar instead of a ribbon.
- TextControl: the properties, methods and events of the editor.