# GetLineFromPoint Method

> Returns the zero-based index of the line that contains a point given in pixels from the top left corner of the TXTextControl, or -1 if an error has occurred.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > GetLineFromPoint Method
- **206 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefrompoint-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefrompoint-method/llms.txt
- **LLMs-Full URL:** 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. The point must be specified in pixels from the top left corner of the control.

### Syntax

```vbscript
TXTextControl.GetLineFromPoint X, Y
```

### Parameters

| Parameter | Description |
|---|---|
| X, Y | Specifies a geometric position in pixels. |

### Return Value

The method returns a line index, starting with 0 for the first line. The return value is -1 if an error has occurred.

### Data Types

| Name | Data type |
|---|---|
| X, Y | Long |
| Return value | Long |

### See Also

- [GetLineCount Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinecount-method/llms-full.txt)
- [GetLineFromChar Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefromchar-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:** [GetLineFromChar Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefromchar-method/llms-full.txt)
- **Next:** [GetLineRect Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinerect-method/llms-full.txt)
