Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#2

Re: TMemo: Zeilenindex der Cursorposition ermitteln

  Alt 18. Mai 2007, 13:14
Aus der Hilfe:

Zitat:
Use CaretPos to determine the coordinates of the cursor. TPoint type defines a pixel location onscreen, with the origin in the top left corner. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate. CaretPos indicates the X and Y position relative to the client origin of the memo.

To determine the position of the caret in terms of characters of text only (rather than X/Y location), use the SelStart property.

Zitat:
Read SelStart to determine the position of the first selected character, where 0 indicates the first character. If there is no selected text, SelStart indicates the position of the cursor. Set SelStart to remove the current selection and position the cursor just before the indicated character.

To select a particular range of the text, first set SelStart to position the cursor, and then set SelLength to extend the selection.
Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat