# Create Your First Windows Forms Application

> Create a .NET Windows Forms app, install TXTextControl.TextControl.WinForms.SDK, and build a word processor with a ribbon, rulers and a status bar.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for Windows Forms > Getting Started > Document Editor > Create Your First Windows Forms Application
- **1988 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/first-application/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/first-application/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/first-application/llms-full.txt

---

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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/requirements/visual-studio/llms-full.txt).
- 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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/setup/llms-full.txt).

### Create the Project

1. Open Visual Studio and create a new project.
2. 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#.
3. Select the project template **Windows Forms App** and click **Next**.

    ![The Create a new project dialog of Visual Studio with the filters C#, Windows and Desktop and the template Windows Forms App selected.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/vs-new-project-winforms.7bfad4a5.webp)
4. Enter a project name and click **Next**.
5. Select .NET 8 or higher as the **Framework**, for example .NET 10, and click **Create**.

    ![The Additional information page of Visual Studio for the Windows Forms App template, with .NET 8.0 (Long Term Support) selected in the Framework list.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/vs-framework-net8.62733224.webp)

The template **Windows Forms App (.NET Framework)** creates a .NET Framework project instead, which [Create a .NET Framework Application](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/dotnet-framework/llms-full.txt) covers.

### Install the NuGet Package

1. Select the project in **Solution Explorer** and choose **Project** > **Manage NuGet Packages...**.
2. Select **Text Control Offline Packages** in the **Package source** list and click **Browse**.
3. Select `TXTextControl.TextControl.WinForms.SDK` and click **Install**.

    ![The NuGet Package Manager of Visual Studio with Text Control Offline Packages as the package source and TXTextControl.TextControl.WinForms.SDK selected, here in version 32.0.2.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/nuget-winforms-sdk.d90b8858.webp)

The package contains the controls, the document engine and your license. See [Package Overview](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/nuget/packages/llms-full.txt) for what it adds to the project.

### Add the Editor to the Form

1. Open **Form1** in the designer from **Solution Explorer**.
2. In the **Toolbox**, open the tab **TX Text Control 34.0**, select **TextControl** and draw the control onto the form.

    ![The Visual Studio Toolbox with the tab TX Text Control 32.0 open and the item TextControl marked, followed by ButtonBar, RulerBar, StatusBar and the ribbon tabs.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/toolbox-textcontrol.ffc98d56.webp)
3. 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**.

    ![A TextControl on Form1 in the designer with its TextControl Tasks smart tag open, showing the Appearance, Information and Wizards groups with Add a Ribbon, Add a ButtonBar, Add a StatusBar, Add a Ruler, Add a Vertical Ruler, the three sidebar wizards and Arrange Controls Automatically.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/smart-tag-wizards-group.b6cec14e.webp)
4. Click **Arrange Controls Automatically**. The controls are now connected to the `TextControl` and docked so that they fill the form.

### Add the Ribbon Tabs

1. Select the ribbon by clicking its blue **File** tab title.
2. Click the smart tag in the upper right corner of the ribbon.
3. Click **Add a RibbonFormattingTab**, **Add a RibbonInsertTab**, **Add a RibbonPageLayoutTab**, **Add a RibbonViewTab** and **Add a RibbonProofingTab**.

    ![The form in the designer with the ribbon tabs File, Home, Insert, Page Layout, View and Proofing, and the Ribbon Tasks smart tag listing the Add a Ribbon...Tab commands.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/ribbon-smart-tag-add-tabs.394d6c62.webp)

Each tab is a ready-made set of commands for the editor. [Built-in Ribbon Tabs](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/ribbon/#the-predefined-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.

![The running Windows Forms application with the Home tab of the ribbon, the horizontal and vertical rulers, the page with the text textControl1 and the status bar with the language and a zoom slider.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/ribbon-app-running.0f542a1f.webp)

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:

```csharp
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:

- `Load += Form1_Load` connects the handler to the `Load` event of the form.
- [ViewMode](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/viewmode-property/llms-full.txt) sets how the document is displayed. `PageView` shows pages with gaps and a background.
- [Load](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/load-method/llms-full.txt) replaces the contents of the editor with the file. `StreamType.WordprocessingML` is the DOCX format.

### 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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/toolbox/llms-full.txt).
- **Text Control Offline Packages is not in the Package source list.** See [Configuring Package Sources](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/nuget/sources/llms-full.txt).
- **License questions.** In a .NET project, the package brings the license, and nothing else is needed. See [Development Licenses](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/licensing/development/llms-full.txt).

### Next Steps

- [Load and Save Documents](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/load-save/llms-full.txt): open and save documents with and without dialog boxes.
- [Create a Ribbon Application with Sidebar Support](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/ribbon-sidebar/llms-full.txt): add sidebars and a RibbonForm.
- [Add Rulers, Toolbars, and a Status Bar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/rulers-toolbars/llms-full.txt): build the editor with a classic button bar instead of a ribbon.
- [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/textcontrol/llms-full.txt): the properties, methods and events of the editor.

---

## Nearby

- **Previous:** [Document Editor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/llms-full.txt)
- **Next:** [Create a .NET Framework Application](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/dotnet-framework/llms-full.txt)
