TE Edit Control .NET Core / .NET Framework Help
Product page

TerTextPosToPix

Retrieve the pixel position of the text.

bool TerTextPosToPix( RelativeTo, line, col, out x, out y)
int RelativeTo;This parameter should be set to one of the following constants:

REL_SCREEN: To return the x/y values relative to the top of the screen.

REL_WINDOW: To return the x/y values relative to the client area of the edit control.

REL_TEXT_BOX: To return the x/y values relative to the top of the text box.

int line;The line number of the text to find position. Set this parameter to -1 to retrieve the pixel position of the text at the current caret location.
int col;The column number of the text to find position. To specify an absolute location, set the col to -1, and specify the absolute position in the 'line' argument.
int x;The parameter to receive the x pixel position.
int y;The parameter to receive the y pixel position.

Return Value: This function returns true when successful.

Example: The example below retrieves the pixel position at the current cursor location relative to the top of the text box.

int x,y,

TerTextPosToPix( REL_TEXT_BOX, -1, -1, out x, out y);