# GetCaretRect Method

> Returns the rectangle covered by the caret at the current input position as an array of 4 Long values (left, top, right, bottom) in pixels from the control.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > GetCaretRect Method
- **141 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcaretrect-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcaretrect-method/llms.txt
- **LLMs-Full URL:** 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. The dimensions are given in pixels with an origin at the top left corner of the control.

Introduced: 22.0.

### Syntax

```vbscript
TXTextControl.GetCaretRect
```

### Return Value

The method returns an array of 4 long values specifying the left, top, right and bottom border of the requested rectangle in pixels.

### Data Types

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

### See Also

- [Programming Category: Text Selections and Character Input](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/selections/llms-full.txt)

---

## Nearby

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