# Text Selections and Character Input

> Get and set the selection and input position of TXTextControl with SelStart, SelLength and SelText and handle Click, KeyPress, MouseDown and PosChange events.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control ActiveX > API Reference > Programming Categories > Text Selections and Character Input
- **1074 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/categories/selections/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/categories/selections/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/categories/selections/llms-full.txt

---

The selection and the input position decide where `TXTextControl` inserts and formats text. The members below read and set the selected text, its start and length, the insertion mode and the caret position.

The events report mouse clicks, key strokes and changes of the input position, which is how an application reacts to the user's character input.

### Properties

| Member | Description |
|---|---|
| [`TXTextControl.CurrentInputPosition`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/currentinputposition-property/llms-full.txt) | Returns or sets an array of three values which specify the page, line and column number of the current text input position. |
| [`TXTextControl.FormatSelection`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/formatselection-property/llms-full.txt) | Specifies whether character and paragraph formatting properties apply to the whole text or to a particular selection only. |
| [`TXTextControl.HideSelection`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/hideselection-property/llms-full.txt) | Specifies whether a text selection is hidden when the `TXTextControl` loses the input focus. |
| [`TXTextControl.InsertionMode`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/insertionmode-property/llms-full.txt) | Specifies whether text is inserted or overwrites existing text. |
| [`TXTextControl.SelectObjects`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/selectobjects-property/llms-full.txt) | Specifies a value controlling the selection of objects such as images and textframes which are inserted behind the text. |
| [`TXTextControl.SelLength`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/sellength-property/llms-full.txt) | Returns or sets the number of characters selected. |
| [`TXTextControl.SelStart`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/selstart-property/llms-full.txt) | Returns or sets the starting point of text selected or indicates the position of the insertion point if no text is selected. |
| [`TXTextControl.SelText`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/seltext-property/llms-full.txt) | Returns or sets the string containing the currently selected text. |

### Methods

| Member | Description |
|---|---|
| [`TXTextControl.GetCaretRect`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcaretrect-method/llms-full.txt) | Returns the rectangular area covered by the caret which indicates the current text input position. |
| [`TXTextControl.InputPosFromPoint`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/inputposfrompoint-method/llms-full.txt) | Returns the text input position belonging to a certain geometric position. |

### Events

| Member | Description |
|---|---|
| [`TXTextControl.Click`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/click-event/llms-full.txt) | Occurs when the user presses and then releases a mouse button over a `TXTextControl`. |
| [`TXTextControl.DblClick`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/dblclick-event/llms-full.txt) | Occurs when the user presses and releases a mouse button and then presses and releases it again over a `TXTextControl`. |
| [`TXTextControl.KeyDown`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/keydown-event/llms-full.txt) | Occurs when the user presses a key while the `TXTextControl` has the input focus. |
| [`TXTextControl.KeyPress`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/keypress-event/llms-full.txt) | Occurs when the user presses and releases an ANSI key while the `TXTextControl` has the input focus. |
| [`TXTextControl.KeyStateChange`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/keystatechange-event/llms-full.txt) | Occurs when the character insertion mode or when the state of the NUMLOCK or CAPSLOCK key has been changed. |
| [`TXTextControl.KeyUp`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/keyup-event/llms-full.txt) | Occurs when the user releases a key while the `TXTextControl` has the input focus. |
| [`TXTextControl.MouseDown`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mousedown-event/llms-full.txt) | Occurs when the user presses a mouse button. |
| [`TXTextControl.MouseMove`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mousemove-event/llms-full.txt) | Occurs when the user moves the mouse. |
| [`TXTextControl.MouseUp`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mouseup-event/llms-full.txt) | Occurs when the user releases a mouse button. |
| [`TXTextControl.PosChange`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/poschange-event/llms-full.txt) | Occurs when the current character input position has been changed. |

### Related Pages

- [Clipboard Operations](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/clipboard/llms-full.txt): cut, copy and paste.
- [Line and Character Operations](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/line-character/llms-full.txt): map characters, lines and screen coordinates.
- [Mouse and Keyboard Assignment](https://docs.textcontrol.com/tx-text-control-activex/reference/assignments/llms-full.txt): what each mouse action and key does in the control.

---

## Nearby

- **Previous:** [Using Footnotes](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/footnotes/llms-full.txt)
- **Next:** [Restricted Document Access](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/restricted-access/llms-full.txt)
