# TextControl Class

> The TextControl class implements a control with high-level text editing features. It is inherited from the System.Web.UI.WebControls.WebControl class. The following describes only the properties, methods and events defined through the TextControl class. For a list of properties, methods and events inherited from the System.Web.UI.WebControls.WebControl class see the .NET Framework reference.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 21.0
- **Namespace:** `TXTextControl.Web`
- **Assembly:** `TXTextControl.Web.dll`, which the TX Text Control .NET Server setup installs, for .NET Framework; in no NuGet package
- **Inherits:** `System.Web.UI.WebControls.WebControl`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > TextControl Class
- **2924 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/llms-full.txt

---

### Description

The TextControl class implements a control with high-level text editing features. It is inherited from the `System.Web.UI.WebControls.WebControl` class. The following describes only the properties, methods and events defined through the `TextControl` class. For a list of properties, methods and events inherited from the `System.Web.UI.WebControls.WebControl` class see the .NET Framework reference.

### Syntax

```csharp
public class TextControl : WebControl
```

```vbnet
Public Class TextControl
  Inherits WebControl
```

### Examples

The following example creates a Text Control object and prepares it for a document workflow.

```csharp
TXTextControl.Web.MVC.TextControl textControl = new();
Console.WriteLine("Text Control is ready for the document workflow.");
```

```vbnet
Dim textControl As New TXTextControl.Web.MVC.TextControl()
Console.WriteLine("Text Control is ready for the document workflow.")
```

---

## In This Section

- [TextControl.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/backcolor-property/llms-full.txt): Specifies or returns the background color of the main text area and the ruler bars.
- [TextControl Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/constructor/llms-full.txt): Initializes a new instance of the TextControl class.
- [TextControl.ContextMenusEnabled Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/contextmenusenabled-property/llms-full.txt): Specifies or returns a value indicating if a right click opens a context menu or not.
- [TextControl.ControlChars Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/controlchars-property/llms-full.txt): Specifies if control characters are visible or not.
- [TextControl.Culture Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/culture-property/llms-full.txt): Gets or sets the control's culture. Affects date and time string formats, for example.
- [TextControl.Dock Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/dock-property/llms-full.txt): Gets or sets a value how the control is docked to its container or web site.
- [TextControl.DocumentTargetMarkers Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/documenttargetmarkers-property/llms-full.txt): Specifies or returns a value indicating if markers for hypertext targets are shown in the editor or not.
- [TextControl.EditMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/editmode-property/llms-full.txt): Specifies or returns a value of type Web.EditMode indicating whether the document's text is read-only, can be selected or is editable.
- [TextControl.FormattingPrinter Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/formattingprinter-property/llms-full.txt): Gets or sets the name of a printer the text dimensions and capabilities of which are used to format the document. If the document is printed with this printer the displayed and the printed document have the same dimensions. If the property is set to Standard, the system installed standard printer is used to format the document. If the property is set to Display, the font dimensions of the display device are used to format the document. If the specified printer is not installed, the standard printer is used.
- [TextControl.GetFileDirectory Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/getfiledirectory-method/llms-full.txt): Returns the directory path where the files of a specific file type are stored.
- [TextControl.GetFileDirectoryAsync Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/getfiledirectoryasync-method/llms-full.txt): Returns the directory path where the files of a specific file type are stored.
- [TextControl.IsReady Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/isready-property/llms-full.txt): Gets a value indicating whether all TX Text Control components are completely loaded in the service's worker process.
- [TextControl.LoadDataFromJson Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loaddatafromjson-method/llms-full.txt): Uses data given as a JSON string as a data source. The JSON string has to contain an array of equally structured objects. Analyzes and uses the given objects as merge data in the same way as the method LoadDataFromModel.
- [TextControl.LoadDataFromJsonAsync Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loaddatafromjsonasync-method/llms-full.txt): Uses data given as a JSON string as a data source. The JSON string has to contain an array of equally structured objects. Analyzes and uses the given objects as merge data in the same way as the method LoadDataFromModel. The method returns immediately.
- [TextControl.LoadDataFromModel Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loaddatafrommodel-method/llms-full.txt): Loads a collection implementing interface System.Collections.IEnumerable as a data source.
- [TextControl.LoadDataFromModelAsync Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loaddatafrommodelasync-method/llms-full.txt): Loads a collection implementing interface System.Collections.IEnumerable as a data source.
- [TextControl.LoadDataSet Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loaddataset-method/llms-full.txt): Loads a database which is used to create table and field name menu items in the mailings ribbon tab from an existing DataSet object.
- [TextControl.LoadDataSetAsync Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loaddatasetasync-method/llms-full.txt): Loads a database which is used to create table and field name menu items in the mailings ribbon tab from an existing DataSet object. This method returns immediately and does not wait for the DataSet to be loaded completely.
- [TextControl.LoadText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadtext-method/llms-full.txt): Loads text in a certain format. The complete contents of a TextControl are replaced.
- [TextControl.LoadTextAsync Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadtextasync-method/llms-full.txt): Loads text in a certain format. The complete contents of a Text Control are replaced. This method returns immediately and does not wait for the text to be completely loaded.
- [TextControl.LoadXMLDatabase Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadxmldatabase-method/llms-full.txt): Loads an XML database which is used to create table and field name menu items in the mailings ribbon tab.
- [TextControl.LoadXMLDatabaseAsync Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadxmldatabaseasync-method/llms-full.txt): Loads an XML database which is used to create table and field name menu items in the mailings ribbon tab. The method returns immediately and does not wait for the database to be completely loaded.
- [TextControl.ResetContents Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/resetcontents-method/llms-full.txt): Deletes the entire contents of the control.
- [TextControl.SaveDocumentQuestionDialogEnabled Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/savedocumentquestiondialogenabled-property/llms-full.txt): Specifies or returns a value indicating if a confirmation dialog should be shown before discarding unsaved changes.
- [TextControl.SaveText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/savetext-method/llms-full.txt): Saves the complete contents of a document with the specified format.
- [TextControl.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/selection-property/llms-full.txt): Gets or sets the current selection in the text part with the input focus. The property value is an object of the type Web.Selection.
- [TextControl.ServiceAddress Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/serviceaddress-property/llms-full.txt): Gets or sets the IP address at which the websocket handler tries to connect to the Service. The default value is 127.0.0.1 (the local computer). Important: setting this property affects all instances of class Web.TextControl. It was not made static so it shows up in the Visual Studio designer.
- [TextControl.ServicePort Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/serviceport-property/llms-full.txt): Gets or sets the Port at which the websocket handler tries to connect to the Service. Important: setting this property affects all instances of class Web.TextControl. It was not made static so it shows up in the Visual Studio designer.
- [TextControl.SetFileDirectory Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/setfiledirectory-method/llms-full.txt): Determines the directory path where the files of a specific file type are stored.
- [TextControl.SetFileDirectoryAsync Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/setfiledirectoryasync-method/llms-full.txt): Determines the directory path where the files of a specific file type are stored.
- [TextControl.StatusBarColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/statusbarcolor-property/llms-full.txt): Specifies or returns the background color of the status bar.
- [TextControl.TableGridLines Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/tablegridlines-property/llms-full.txt): Specifies or returns a value indicating wether table grid lines are shown in the editor or not.
- [TextControl.TextFieldsEditable Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/textfieldseditable-property/llms-full.txt): Gets or sets if text fields are editable or not.
- [TextControl.TextFrameMarkerLines Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/textframemarkerlines-property/llms-full.txt): Specifies whether text frames that have no border line are shown with marker lines.
- [TextControl.TextParts Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/textparts-property/llms-full.txt): Gets a collection of all text parts the current document contains. The property's value is an object of the type Web.TextPartCollection. A text part can be the main text, a text frame or a header or footer.
- [TextControl.UICulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/uiculture-property/llms-full.txt): Gets or sets the control's user interface culture. Affects the string resource language.
- [TextControl.UserNames Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/usernames-property/llms-full.txt): Gets or sets a list of names specifying users who have access to editable regions. When a document is set to read-only all editable regions that are related to these users can be edited.
- [TextControl.WebSocketHandlerPath Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/websockethandlerpath-property/llms-full.txt): Specifies the path to the WebSocket handler (TXWebSocketHandler.ashx). If set to null (the default value) or an empty string, the browser derives the WebSocket handler URL from the current page's URL. This property sets the portion of the path BETWEEN the web site root and the handler-ashx-file (e. g. "/foo/bar/" in case of the handler listening at ws://www.website.com/foo/bar/TXWebSocketHandler.ashx). In most cases this property doesn't need to be set and the browser generated URL works fine. However, if the web control is used in an ASP.Net MVC application and the web page containing the editor resides in a virtual directory, the WebSocket handler URL generated by the browser will be invalid. This makes it impossible for the web app to connect to the web server. Use this property to correct the WebSocket handler URL in that case. Absolute (e. g. "/editor/") and relative directories (e. g. "../../") are possible.

---

## Nearby

- **Previous:** [StringStreamType Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/stringstreamtype/enumeration/llms-full.txt)
- **Next:** [TextControl.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/backcolor-property/llms-full.txt)
