# GetCharRect Method

> Returns the rectangle covered by the character with the given zero-based index as an array of 4 Long values (left, top, right, bottom) in twips.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > GetCharRect Method
- **343 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharrect-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharrect-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharrect-method/llms-full.txt

---

Returns the rectangular area covered by a certain character. The dimensions are given in [twips](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/#measure-in-twips) with an origin at the upper left corner of the Text Control's complete text. The relationship between the upper left corner of the complete text and the upper left corner of the control can be obtained with the [ScrollPosX](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/scrollposx-property/llms-full.txt) and the [ScrollPosY](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/scrollposy-property/llms-full.txt) properties.

Introduced: 22.0.

### Syntax

```vbscript
TXTextControl.GetCharRect Char
```

### Parameters

| Parameter | Description |
|---|---|
| Char | Specifies the index of the character which rectangle is returned. The index of the first character is zero. |

### Return Value

The method returns an array of 4 long values specifying the left, top, right and bottom border of the requested rectangle in [twips](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/#measure-in-twips).

### Data Types

| Name | Data type |
|---|---|
| Char | Long |
| Return value | Array of 4 Long |

### See Also

- [ScrollPosX Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/scrollposx-property/llms-full.txt)
- [ScrollPosY Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/scrollposy-property/llms-full.txt)
- [GetLineRect Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinerect-method/llms-full.txt)
- [Programming Category: Line and Character Operations](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/line-character/llms-full.txt)

---

## Nearby

- **Previous:** [GetCharFromLine Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharfromline-method/llms-full.txt)
- **Next:** [GetLineCount Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinecount-method/llms-full.txt)
