Online
Registriert seit: 3. Sep 2023
379 Beiträge
|
AW: TRichEdit - veim Verlassen auf den Anfang des Dokuments springen
3. Okt 2024, 19:45
Hi,
This works for me,
Delphi-Quellcode:
const
EM_GETSCROLLPOS = $04DD;
EM_SETSCROLLPOS = $04DE;
procedure RichEditScrollToPoint(ARichEdit: TRichEdit; X, Y: Integer);
var
Pos: TPoint;
begin
Pos.X := X;
Pos.Y := Y;
//PostMessage(RichEdit1.Handle,EM_SETSCROLLPOS,wParam(0),lParam(@FPos)); // ONLY use PostMessage if Pos is on the heap (not local var) !!
// or
SendMessage(ARichEdit.Handle, EM_SETSCROLLPOS, wParam(0), lParam(@Pos));
end;
procedure TForm10.RichEdit1Exit(Sender: TObject);
begin
RichEditScrollToPoint(RichEdit1, 0, 0);
end;
Kas
|
|
Zitat
|