W jaki sposób określić pozycje kursora w komponenci

0

Pytakie takie samo jak w temacie z tym, że chciałbym uzyskać tą pozycję w pikselach a nie w numerze kolumny i wierszu.

0

Hmmm... dziwna sprawa. Wg helpa do Delphi powinno to byc RichEdit1.CaretPos : Tpoint.

Use CaretPos to determine the coordinates of the cursor. CaretPos defines a pixel location onscreen, with the origin in the top left corner of the memo. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.

Ale jak sprobowalem, to wyswietla numer wiersza i kolumny. Bardzo dziwne...

Dopisane 10:22
juz wiem:

var
c:TPoint;
begin
SendMessage(RichEdit1.Handle, EM_POSFROMCHAR, Integer(@c), RichEdit1.SelStart);
Label1.Caption:=IntToStr(c.x)+' '+IntToStr(c.Y);

0

Dzięki pq za przykład. [cya]

1 użytkowników online, w tym zalogowanych: 0, gości: 1