# Document Editor

> Build a Windows Forms word processor with TextControl: lifecycle, loading, formatting, tables, fields, forms, track changes, ribbon, dialog boxes and events.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for Windows Forms > Document Editor
- **1505 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/llms-full.txt

---

A Windows Forms application with a `TextControl` on its form is a word processor: users type, format, insert tables and images, review changes and print, while your code loads documents, reacts to events and adds commands of its own. The pages below take each of these subjects further than the first tutorials, from the life of the control on a form to the ribbon, the dialog boxes and the events around it.

If you haven't placed an editor on a form yet, start with the tutorials of [Document Editor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/llms-full.txt) in Getting Started. They create the project, add the control from the Toolbox, connect a ribbon or a button bar and build the file commands that every page here assumes.

![TX Text Control Words, the sample word processor, with its ribbon, the Form Fields tab selected, a horizontal and a vertical ruler, a form with a drop-down list in the document and a status bar.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/form-fields-tab-sample.844adae8.webp)

### How the Editor Works

- **One control holds the document.** [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/llms-full.txt) is a Windows Forms control that you drag from the Toolbox onto a form. Its document consists of the main text, text frames, headers, footers and footnotes.
- **Users need no code.** Typing, selecting, the clipboard keys, undo and the context menus work as soon as the control has the focus.
- **Your code shares the object model.** `Selection` and collections such as `Tables` and `Sections` also belong to [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/llms-full.txt), which [Document Processing](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-processing/llms-full.txt) uses without a user interface.
- **The interface around it is made of controls.** A [Ribbon](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbon/llms-full.txt) or a button bar, rulers, a status bar and sidebars are separate controls that you connect to the `TextControl` through properties, in the designer or in code.

### Find the Right Page

| If you want to | Read |
|---|---|
| Know when the control is ready and where startup code goes | [Architecture and Control Lifecycle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/architecture/llms-full.txt) |
| Work with the selection, the clipboard, undo or search | [Editing Text](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/editing-text/llms-full.txt) |
| Format text and paragraphs | [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/formatting/llms-full.txt) |
| Add tables, images, frames, charts or barcodes | [Tables and Table Formulas](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/tables/llms-full.txt) and the pages after it |
| Build forms that users fill out | [Form Fields and Conditional Instructions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/form-fields/llms-full.txt) |
| Let several people review a document | [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/track-changes/llms-full.txt), [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/comments/llms-full.txt) |
| Change the ribbon, toolbars, sidebars or dialog boxes | [Ribbon and UI](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/llms-full.txt) |

### Where to Start

1. Work through [Create Your First Windows Forms Application](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/first-application/llms-full.txt) and [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).
2. Read [Architecture and Control Lifecycle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/architecture/llms-full.txt), so that your code runs at the right moment and on the right text part.
3. Open the page of the feature you are adding.
4. Compare your form with the [TX Words Sample Application](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/examples/tx-words/llms-full.txt), which combines most features of this section.

### Pages in This Section

- [Architecture and Control Lifecycle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/architecture/llms-full.txt): text parts and the stages of a form.
- [Loading and Saving Documents](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/load-save/llms-full.txt): the Open and Save As dialog boxes, documents in a database, and where each load and save option is described.
- [Document Properties](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/properties/llms-full.txt): title, author and custom properties.
- [Editing Text](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/editing-text/llms-full.txt): selections, clipboard, undo, search and keys.
- [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/formatting/llms-full.txt): fonts, paragraphs and tab stops.
- [Stylesheets](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/stylesheets/llms-full.txt): paragraph and character styles.
- [Bullets and Numbered Lists](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/lists/llms-full.txt): bulleted and numbered lists.
- [Tables and Table Formulas](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/tables/llms-full.txt): tables, cells and formulas.
- [Images](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/images/llms-full.txt): placing images in the text.
- [Text Frames and Shapes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/text-frames-shapes/llms-full.txt): text frames and drawings.
- [Charts and Barcodes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/charts-barcodes/llms-full.txt): chart and barcode frames.
- [Headers and Footers](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/headers-footers/llms-full.txt): headers, footers and page numbers.
- [Sections and Page Layout](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/sections/llms-full.txt): page formats and section breaks.
- [Footnotes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/footnotes/llms-full.txt): footnotes and their numbering.
- [Tables of Contents](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/tables-of-contents/llms-full.txt): generated from structure levels.
- [Fields, Hyperlinks, and Bookmarks](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/fields/llms-full.txt): text fields and links.
- [Subtext Parts](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/subtext-parts/llms-full.txt): named ranges of text.
- [Form Fields and Conditional Instructions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/form-fields/llms-full.txt): fillable forms.
- [Signature Fields](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/signature-fields/llms-full.txt): places for signatures.
- [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/track-changes/llms-full.txt): accepting and rejecting changes.
- [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/comments/llms-full.txt): notes on the text.
- [Document Protection and Editable Regions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/protection/llms-full.txt): read-only documents and editable regions.
- [Spell Checking and Hyphenation](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/spell-checking/llms-full.txt): connecting a spell checker.
- [Viewing, Zooming, and Navigation](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/viewing/llms-full.txt): view modes and zoom.
- [Printing and Print Preview](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/printing/llms-full.txt): dialogs, previews and page ranges.
- [Ribbon and UI](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/llms-full.txt): the controls around the editor.
- [Events](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/events/llms-full.txt): handlers and events by subject.

---

## In This Section

- [Architecture and Control Lifecycle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/architecture/llms-full.txt): Text parts of a Windows Forms TextControl, where code goes from InitializeComponent and OnLoad to FormClosing, and a control that grows with AutoControlSize.
- [Charts and Barcodes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/charts-barcodes/llms-full.txt): Charts and barcodes in a Windows Forms TextControl: the chart gallery, Chart Layout tab, barcode types and dialog, and changing a selected ChartFrame in C#.
- [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/comments/llms-full.txt): Add, answer, edit and remove comments in a Windows Forms TextControl with CommentCollection and CommentedText, the Comments sidebar, CommentsDialog and events.
- [Editing Text](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/editing-text/llms-full.txt): Select, copy, undo, find and drag text in a Windows Forms TextControl: built-in keys and ribbon commands, and the C# API for your own menus and shortcuts.
- [Events](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/events/llms-full.txt): Connect event handlers to the Windows Forms TextControl, track unsaved changes with Changed and DocumentLoaded, find events by subject and override On methods.
- [Fields, Hyperlinks, and Bookmarks](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/fields/llms-full.txt): Use TextField, MS Word ApplicationField, HypertextLink, DocumentTarget bookmarks and DocumentLink in a Windows Forms TextControl and handle link clicks in C#.
- [Footnotes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/footnotes/llms-full.txt): Insert footnotes in a Windows Forms TextControl with the References tab or FootnoteCollection.Add, set their number format, find and remove them, use events.
- [Form Fields and Conditional Instructions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/form-fields/llms-full.txt): Design Windows Forms forms with text, check box, drop-down and date fields, protect and preview them, read values and check them with conditional instructions.
- [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/formatting/llms-full.txt): Format characters and paragraphs in Windows Forms with Selection and ParagraphFormat: fonts, colors, indents, tab stops, formatting dialogs, CharFormatChanged.
- [Headers and Footers](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/headers-footers/llms-full.txt): Add headers, footers and Page x of y numbers in a Windows Forms TextControl with HeaderFooterCollection and PageNumberField, and set how users activate them.
- [Images](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/images/llms-full.txt): Insert, anchor and scale images in a Windows Forms TextControl with ImageCollection.Add, the Frame Formatting tab, ImageAttributesDialog and save settings.
- [Bullets and Numbered Lists](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/lists/llms-full.txt): Create bulleted, numbered and structured lists with ListFormat in Windows Forms, use the Bullets and Numbering dialog, restart numbering and define list styles.
- [Loading and Saving Documents](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/load-save/llms-full.txt): Configure the Open and Save As dialog boxes of a Windows Forms TextControl: file filters, DefaultStreamType, DialogSettings options and the file the user chose.
- [Printing and Print Preview](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/printing/llms-full.txt): Print from a Windows Forms TextControl: Print and PrintPreview overloads, a PrintDialog with page ranges, single pages from PrintPage and the FormattingPrinter.
- [Document Properties](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/properties/llms-full.txt): Set title, author, keywords and user-defined properties with DocumentSettings in Windows Forms, show them in the sidebar and override them with SaveSettings.
- [Document Protection and Editable Regions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/protection/llms-full.txt): Protect documents in a Windows Forms TextControl with EditMode and DocumentPermissions, mark editable regions per user and use the Permissions ribbon tab.
- [Ribbon and UI](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/llms-full.txt): Choose and customize the Windows Forms UI around TextControl: Ribbon tabs, ButtonBar, mini toolbars, RulerBar, StatusBar, Sidebar, dialogs and localization.
- [Sections and Page Layout](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/sections/llms-full.txt): Insert section breaks, set landscape pages, margins and columns in a Windows Forms TextControl with SectionCollection, SectionFormat and the Page Setup dialog.
- [Signature Fields](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/signature-fields/llms-full.txt): Prepare documents for signing in Windows Forms: insert SignatureField frames with the ribbon or in C#, store SignerData, set signature images and handle events.
- [Spell Checking and Hyphenation](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/spell-checking/llms-full.txt): Connect TX Spell .NET to a Windows Forms TextControl, use SpellCheckText for another checker, ignore MisspelledWords in code and control HyphenateWord.
- [Stylesheets](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/stylesheets/llms-full.txt): Create, apply and update ParagraphStyle and InlineStyle in Windows Forms: the [Normal] style, the Styles gallery and sidebar, and styles copied from a template.
- [Subtext Parts](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/subtext-parts/llms-full.txt): Mark text ranges as SubTextPart objects in a Windows Forms TextControl: highlight them, store data, nest, list, save and remove them and react to their events.
- [Tables of Contents](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/tables-of-contents/llms-full.txt): Generate tables of contents from structure levels in Windows Forms: paragraph styles, the References tab and dialog, TableOfContents in C#, updates and links.
- [Tables and Table Formulas](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/tables/llms-full.txt): Insert, merge and edit tables in a Windows Forms TextControl, calculate cells with formulas in A1 or R1C1 style, catch FormulaException and set number formats.
- [Text Frames and Shapes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/text-frames-shapes/llms-full.txt): Let users draw text frames and shapes in a Windows Forms TextControl, or insert them in C# with TextFrameCollection, TXDrawingControl, Shape and DrawingFrame.
- [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/track-changes/llms-full.txt): Record insertions and deletions in a Windows Forms TextControl: set the author with UserNames, list, accept and reject TrackedChange objects and handle events.
- [Viewing, Zooming, and Navigation](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/viewing/llms-full.txt): Set ViewMode and ZoomFactor, show control characters, go to a page, scroll with ScrollLocation and find the visible page in a Windows Forms TextControl.

---

## Nearby

- **Previous:** [Digitally Sign a PDF](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/pdf/sign/llms-full.txt)
- **Next:** [Architecture and Control Lifecycle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/architecture/llms-full.txt)
