# Document Editor Examples

> Samples of the WPF TextControl as an editor: a print preview, tab stop guides, line numbers, a date picker for fields, hyperlinks and the mini toolbar.

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

---

These samples extend the editing window of TX Text Control .NET for WPF: a print preview, guides and line numbers drawn over the document, a date picker for fields, hyperlinks and the mini toolbar. Each one is a small project that shows one technique around the [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt), and the tables name the version and the framework it was written for.

### Before You Run an Older Sample

Most of these samples target the .NET Framework and reference the assemblies of an earlier version of TX Text Control. Reference the assemblies of your installation and update the version in *licenses.licx*, as [GitHub Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/github/#update-an-older-sample) describes. Samples for .NET 6 need the target framework .NET 8 or higher and the current package.

### Single Samples

| Example | What it shows | Where |
|---|---|---|
| Print preview | A print preview that WPF lacks: each page is rendered with [Page.GetImage](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/page/getimage-method/llms-full.txt) and shown in the WPF `DocumentViewer`, as described in [New Sample: Building a Print Preview for TX Text Control .NET for WPF](https://www.textcontrol.com/blog/2010/12/10/new-sample-building-a-print-preview-for-tx-text-control-net-for-wpf/). .NET Framework 4.8, version 33.0, C# | [TextControl.WPF.PrintPreview](https://github.com/TextControl/TextControl.WPF.PrintPreview) |
| Line numbers | Line numbers next to each line of text, placed over the editor with [PointFromDocument](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pointfromdocument-method/llms-full.txt) and the [Lines](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/lines-property/llms-full.txt) collection, as described in [Displaying Line Numbers in Windows Forms and WPF](https://www.textcontrol.com/blog/2018/08/17/displaying-line-numbers-in-windows-forms-and-wpf/). .NET Framework 4.8, version 33.0, C# | [TextControl.WPF.LineNumbering](https://github.com/TextControl/TextControl.WPF.LineNumbering) |
| Tab stop guides | Vertical guides from the ruler down the page at the tab positions of the current paragraph, updated in [ParagraphFormatChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/paragraphformatchanged-event/llms-full.txt). .NET Framework 4.5, version 33.0, C# | [TextControl.WPF.TabStopGuides](https://github.com/TextControl/TextControl.WPF.TabStopGuides) |
| Date picker for date fields | A WPF `DatePicker` that opens when the user clicks a date field, in the [TextFieldClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textfieldclicked-event/llms-full.txt) event, and writes the date through [DateField](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/datefield/llms-full.txt). .NET Framework 4.5, version 22.0, C# | [TextControl.WPF.DatePicker](https://github.com/TextControl/TextControl.WPF.DatePicker) |

### Official Samples

The how-to and tutorial samples of [TXSamples\_WPF\_CSharp](https://github.com/TextControl/TXSamples_WPF_CSharp) and [TXSamples\_WPF\_VB.NET](https://github.com/TextControl/TXSamples_WPF_VB.NET) are written for version 32.0, for the .NET Framework 4.8 and .NET 6:

| Example | What it shows | Where |
|---|---|---|
| Simple | The smallest word processor: loading and saving, the clipboard, formatting dialog boxes, two [RulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/rulerbar/llms-full.txt) controls, a [ButtonBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/buttonbar/llms-full.txt) and a [StatusBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/llms-full.txt) | [TXSamples\_WPF\_CSharp](https://github.com/TextControl/TXSamples_WPF_CSharp), folder *Tutorial* |
| Hyperlinks | Hypertext links and link targets in three steps, and the events of a clicked link | [TXSamples\_WPF\_CSharp](https://github.com/TextControl/TXSamples_WPF_CSharp), folder *Howto* |
| Mini toolbar | Groups of the [MiniToolbar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/wpf-minitoolbar/llms-full.txt) that depend on what is selected; [ShowMiniToolbar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/showminitoolbar-property/llms-full.txt) switches it on | [TXSamples\_WPF\_CSharp](https://github.com/TextControl/TXSamples_WPF_CSharp), folder *Howto* |

The how-to samples for spreadsheet formulas and XML files are listed in [Document Processing Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/document-processing/#wpf-samples). The TX Words samples show context menus, keyboard shortcuts, drag and drop, hyperlinks, right-to-left text and editable regions for each user; see [TX Words WPF Sample Application](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/tx-words/llms-full.txt).

### Blog Articles With Code

These articles contain their complete code, without a repository:

| Example | What it shows | Where |
|---|---|---|
| Insert image dialog | A dialog box of your own for inserting images, with the file filters of the supported image formats | [Custom Insert Image Dialog in TX Text Control .NET for WPF](https://www.textcontrol.com/blog/2020/07/02/custom-insert-image-dialog-in-wpf/) |

### Next Steps

- [Ribbon and Sidebar Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/ribbon-sidebar/llms-full.txt): samples of the ribbon tabs and the sidebars.
- [Printing and Print Preview](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/printing/llms-full.txt): print documents from the editor.
- [GitHub Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/github/llms-full.txt): run a sample and update it to the current version.

---

## Nearby

- **Previous:** [GitHub Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/github/llms-full.txt)
- **Next:** [Ribbon and Sidebar Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/ribbon-sidebar/llms-full.txt)
