Registriert seit: 6. Apr 2005
10.109 Beiträge
|
Re: TRichEdit/TDBRichEdit: Zeichen unter der Maus ermitteln?
24. Jan 2006, 17:08
Hi freejay,
schau mal hier:
Delphi-Quellcode:
procedure TDemoForm.RichEditMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
iLine, iOffset, iPos: Integer;
p: TPointL;
begin
with RichEdit do
begin
p.x := x;
p.y := Y;
iOffset := Perform(EM_CHARFROMPOS, 0, Integer(@p));
iLine := Perform(EM_LINEFROMCHAR, iOffset, 0);
iPos := iOffset - Perform(EM_LINEINDEX, iLine, 0);
StatusBar.SimpleText := Format('x = %d y = %d', [iPos, iLine]);
end;
end;
Grüße vom marabu
|
|
Zitat
|