# Visual Studio Designer Integration

> Use the Windows Forms designer with TextControl: smart tag wizards for ribbon, bars and sidebars, Properties window connections, events and licenses.licx.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for Windows Forms > Integration Guide > Visual Studio Designer Integration
- **2328 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/designer/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/designer/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/designer/llms-full.txt

---

In a Windows Forms project, most of the work of putting TX Text Control on a form happens in the Visual Studio designer: smart tags add and connect the bars, the ribbon and the sidebars, and the **Properties** window sets everything else. What each designer feature does, and what it leaves behind in your project, is described below, so that you can rely on the designer for the layout and know where to continue in code.

The toolbox tab **TX Text Control 34.0** and its items are covered by [Visual Studio Toolbox and Designer](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/toolbox/llms-full.txt). The designer needs the setup of TX Text Control on the development machine; the package from the Text Control Private NuGet Feed is meant for build servers.

### What the Designer Writes

Everything you do in the designer is stored as C# code in the file *Form1.Designer.cs*, in the method `InitializeComponent`, which the constructor of the form calls. When you drop a `TextControl` on the form, Visual Studio adds a field `textControl1` and the statements that create it, set its properties and add it to the form's `Controls` collection. A smart tag that connects a ruler to the editor writes the same assignment you would write yourself, such as `textControl1.RulerBar = rulerBar1`.

- **Don't edit *Form1.Designer.cs* by hand.** Visual Studio rewrites it whenever the form changes in the designer. Put your own code in *Form1.cs*, after `InitializeComponent`.
- **The designer doesn't need code to run.** The editor, its bars and its ribbon work as soon as the form opens. Code is needed only for what happens at run time: loading a document, reacting to events, changing the ribbon for a user.
- **The same result in code.** Everything the designer does can be written in code instead, for example for forms that are built at run time. See [Creating and Configuring Controls in Code](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/controls-in-code/llms-full.txt).

### The Smart Tag of the TextControl

Select the `TextControl` on the form and click the small arrow in its upper right corner. The **TextControl Tasks** panel opens:

![The TextControl Tasks smart tag of a TextControl on a form, with the Appearance section for ViewMode, Dock and Text, the Information section with the version, and the Wizards section with links such as Add a Ribbon, Add a Ruler and Arrange Controls Automatically.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/textcontrol-smart-tag-tasks.e4881f3e.webp)

The panel has three sections:

| Section | Entries | What they do |
|---|---|---|
| **Appearance** | **ViewMode**, **Dock**, **Text** | Set the [ViewMode](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/viewmode-property/llms-full.txt) of the editor, such as `PageView`, its docking in the form and the text it starts with |
| **Information** | **Start TXTextControlWords**, **Open the Help and Support Center**, the version | Start the TX Words sample, open the Help and Support Center and show the version and edition of the installed product |
| **Wizards** | **Add a Ribbon**, **Add a ButtonBar**, **Add a StatusBar**, **Add a Ruler**, **Add a Vertical Ruler**, **Add a Bottom Sidebar**, **Add a Left Sidebar**, **Add a Right Sidebar**, **Arrange Controls Automatically** | Add a control and connect it to the editor, and dock all controls so that they fill the form |

Each **Add** wizard creates the control and sets the matching property of the `TextControl`: [ButtonBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/buttonbar-property/llms-full.txt), [RulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/rulerbar-property/llms-full.txt), [VerticalRulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/verticalrulerbar-property/llms-full.txt), [StatusBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/statusbar-property/llms-full.txt) or [Ribbon](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/ribbon-property/llms-full.txt). A sidebar is connected the other way round: its [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/sidebar/textcontrol-property/llms-full.txt) property names the editor. Click **Arrange Controls Automatically** after adding controls, so that the new ones get their place around the editor.

### The Smart Tags of the Ribbon and the Sidebar

The ribbon and the sidebars have smart tags of their own:

- **Ribbon.** Select the ribbon by clicking its blue **File** tab title and open its smart tag. It adds the nine main predefined tabs, such as **Add a RibbonFormattingTab**, adds an empty `RibbonTab`, removes the selected tab and converts the form to a [RibbonForm](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonform/llms-full.txt). The four contextual tabs, such as Table Layout, go into contextual tab groups instead. [Built-in Ribbon Tabs](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/ribbon/llms-full.txt) describes the tabs.

    ![The Ribbon Tasks smart tag of a ribbon on a form, with the links Add a RibbonFormattingTab to Add a RibbonReferencesTab, Add a RibbonTab, Remove RibbonTab and Add a TextControl.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/ribbon-smart-tag-add-tabs.394d6c62.webp)
- **Predefined tabs.** The smart tag of a tab such as the `RibbonFormattingTab` lists its **Connected Sidebars**: which sidebar opens when the user clicks **Find**, **Go To**, **Replace** or the dialog box launcher of the **Styles** group.

    ![The RibbonFormattingTab Tasks smart tag with the Connected Sidebars section, where drop-down lists assign a horizontal and a vertical sidebar to Find, Go To and Replace and a sidebar to the Styles dialog box launcher.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/connected-sidebars.aaebf93b.webp)
- **Sidebar.** The smart tag of a `Sidebar` sets its [ContentLayout](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/sidebar/contentlayout-property/llms-full.txt), such as **Styles** or **TrackedChanges**, its docking, the connected `TextControl` and options such as [IsShown](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/sidebar/isshown-property/llms-full.txt) and [ShowPinButton](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/sidebar/showpinbutton-property/llms-full.txt). [Sidebar and Panels](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/sidebar/llms-full.txt) shows the panel.

    ![The Sidebar Tasks smart tag with the ContentLayout drop-down open, listing None, Custom, Goto, FieldNavigator, TrackedChanges, Styles, Find, Replace, ConditionalInstructions, DocumentSettings, Comments and About, next to a Styles sidebar on the form.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/sidebar-content-layout.0e176eb7.webp)

### The Properties Window

Every property the smart tags set is also in the **Properties** window, together with the ones they don't cover, such as the items of the ribbon's Application Menu in [ApplicationMenuItems](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbon/applicationmenuitems-property/llms-full.txt) and its contextual tab groups in [ContextualTabGroups](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbon/contextualtabgroups-property/llms-full.txt). Properties that connect one component to another show a drop-down list of the matching components on the form. The `MailMerge` component, for example, which the designer places in the component tray below the form, lists the `TextControl` in its [TextComponent](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/mailmerge/textcomponent-property/llms-full.txt) property, as [Where the Merge Runs](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/mail-merge/overview/#where-the-merge-runs) shows.

Connections you make in the **Properties** window:

| Component | Property | Connects |
|---|---|---|
| `TextControl` | `ButtonBar`, `RulerBar`, `VerticalRulerBar`, `StatusBar`, `Ribbon` | The bars and the ribbon, if the smart tag didn't connect them |
| `TextControl` | [SpellChecker](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/spellchecker-property/llms-full.txt) | The `TXSpellChecker` of TX Spell .NET; see [Integrating TX Spell .NET for Windows Forms](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/tx-spell/llms-full.txt) |
| `Sidebar` | `TextControl` | The editor whose content the sidebar shows |
| Predefined ribbon tabs | Sidebar properties, such as `StylesSidebar` | The sidebar a ribbon button opens |
| `MailMerge` | `TextComponent` | The editor that shows the template and the result of the merge |

Some properties of the `TextControl` exist only at run time, such as [Selection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/selection-property/llms-full.txt): they describe the document, not the control, and are not listed in the **Properties** window.

### Events in the Designer

The **Events** page of the **Properties** window, the button with the lightning bolt, lists the events of the selected control. Double-click an event, such as `Changed` of the `TextControl`, and Visual Studio creates a handler in *Form1.cs* and connects it in *Form1.Designer.cs*. [Events](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/events/llms-full.txt) lists the events of the editor by subject.

### Licensing in the Designer

The designer also takes care of the development license:

- **.NET Framework.** Dropping a `TextControl` on a form adds an entry to the project's *licenses.licx* file, from which the license compiler embeds the license into your assembly when you build. Since version 30.0, the entries contain the full assembly version.
- **.NET 8 or higher.** The NuGet package `TXTextControl.TextControl.WinForms.SDK` embeds its license file into your assembly, and no *licenses.licx* entry is needed.

A `TextControl` in a user control of a control library needs one more line of code; see [Embedding the Editor in Forms and UserControls](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/embedding/#put-the-editor-into-a-usercontrol). [Development Licenses](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/licensing/development/llms-full.txt) covers the details.

### When the Designer Doesn't Cooperate

When the toolbox tab is missing, a control can't be dropped on the form or a smart tag can't be found, [Toolbox and Designer](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/troubleshooting/toolbox/llms-full.txt) in Troubleshooting lists the causes. The most frequent one in a .NET project: the package must be installed and the form opened in the designer before the tab appears.

### Next Steps

- [Create Your First Windows Forms Application](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/first-application/llms-full.txt): the designer steps in a complete project.
- [Creating and Configuring Controls in Code](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/controls-in-code/llms-full.txt): the same controls without the designer.
- [Embedding the Editor in Forms and UserControls](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/embedding/llms-full.txt): the editor in user controls, tab pages and ribbon forms.
- [Visual Studio Toolbox and Designer](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/installation/toolbox/llms-full.txt): the items of the toolbox tab.

---

## Nearby

- **Previous:** [Integration Guide](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/llms-full.txt)
- **Next:** [Creating and Configuring Controls in Code](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/integration/controls-in-code/llms-full.txt)
