# Line and Character Operations

> Map character positions, line numbers and screen coordinates in TXTextControl with GetLineFromChar, GetCharFromLine, GetLineRect and GetCharRect.

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

---

Lines and characters of a `TXTextControl` document can be located by index, by point or by rectangle. The methods below convert between character positions, line numbers and screen coordinates and return the number of lines and the base line position.

### Methods

| Member | Description |
|---|---|
| [`TXTextControl.GetBaseLinePos`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getbaselinepos-method/llms-full.txt) | Returns the baseline position of the specified line. |
| [`TXTextControl.GetCharFromLine`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharfromline-method/llms-full.txt) | Returns the position of a line's first character. |
| [`TXTextControl.GetCharRect`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharrect-method/llms-full.txt) | Returns the rectangular area covered by a certain character. |
| [`TXTextControl.GetLineCount`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinecount-method/llms-full.txt) | Returns the number of text lines in a `TXTextControl`. |
| [`TXTextControl.GetLineFromChar`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefromchar-method/llms-full.txt) | Returns the index of the line which contains the character with the specified character position. |
| [`TXTextControl.GetLineFromPoint`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefrompoint-method/llms-full.txt) | Returns the index of the line which contains a given point. |
| [`TXTextControl.GetLineRect`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinerect-method/llms-full.txt) | Returns the rectangular area covered by a line of text. |

### Related Pages

- [Text Selections and Character Input](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/selections/llms-full.txt): selection, input position, mouse and keyboard events.
- [Scrolling](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/scrolling/llms-full.txt): scroll bars, scroll position and caret events.

---

## Nearby

- **Previous:** [Search and Replace](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/search-replace/llms-full.txt)
- **Next:** [Control Settings](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/control-settings/llms-full.txt)
