# XYToDisplayPos Method

## Applies to

THtmlViewer component

## Declaration

function XYToDisplayPos(X, Y: integer): integer;

## Description

Given X, Y coordinates on the display, XYToDisplayPos finds the display character position for that location. Dimensions are in pixels relative to the upper left corner of the display. The character position returned is the same as would be returned by the SelStart property if the mouse were clicked at that location.

XYToDisplayPos returns -1 for X, Y locations where there is no text.

## See Also:

DisplayPosToXY Method

SelStart Property

FindSourcePos Method

FindDisplayPos Method