Einzelnen Beitrag anzeigen

Benutzerbild von haentschman
haentschman

Registriert seit: 24. Okt 2006
Ort: Seifhennersdorf / Sachsen
5.300 Beiträge
 
Delphi 12 Athens
 
#9

AW: RichText und Scrollen mit Mausrad

  Alt 5. Mär 2024, 07:14
Moin...

Heureka...ich habs...mit Hilfe. (jaenicke)
Delphi-Quellcode:
procedure TfrRTFBase.edtRTFMouseWheelDown(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); // #1462
const
  EM_GETSCROLLPOS = $04DD;
  EM_SETSCROLLPOS = $04DE;
var
  ScrollPos: TPoint;
begin
  Handled := True;
  if GetWindowLong(edtRTF.Handle, GWL_STYLE) = conScrollbarVisible then
  begin
    edtRTF.Perform(EM_GETSCROLLPOS, 0, @ScrollPos);
    ScrollPos.Offset(0, 50);
    edtRTF.Perform(EM_SETSCROLLPOS, 0, @ScrollPos);
  end;
end;

procedure TfrRTFBase.edtRTFMouseWheelUp(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); // #1462
const
  EM_GETSCROLLPOS = $04DD;
  EM_SETSCROLLPOS = $04DE;
var
  ScrollPos: TPoint;
begin
  Handled := True;
  if GetWindowLong(edtRTF.Handle, GWL_STYLE) = conScrollbarVisible then
  begin
    edtRTF.Perform(EM_GETSCROLLPOS, 0, @ScrollPos);
    ScrollPos.Offset(0, -50);
    edtRTF.Perform(EM_SETSCROLLPOS, 0, @ScrollPos);
  end;
end;
siehe Video

Danke.
Angehängte Dateien
Dateityp: zip Scroll.zip (540,4 KB, 2x aufgerufen)

Geändert von haentschman ( 5. Mär 2024 um 07:18 Uhr)
  Mit Zitat antworten Zitat