Hello,
I was wondering if there was an example of how to use external scrollbars with wptools 7?
Thank you
Hello,
I was wondering if there was an example of how to use external scrollbars with wptools 7?
Thank you
The event OnUpdateExternScrollbar makes it possible to update the position of an external scrollbar. The parameters are automatically limited to a maximal value of 20000 my calculating a multiplicator value.
This values are accessible through the properties ScrollVertMultiplicator and ScrollHorzMultiplicator.
// Update the position of the scrollbar
procedure TForm1.WPRichText1UpdateExternScrollbar(
Sender: TWPCustomRtfEdit;
ScrollBar: TScrollStyle;
Range, Page,Pos: Integer);
begin
if ScrollBar=ssVertical then
begin
ScrollBar1.PageSize := Page;
ScrollBar1.Max := Range;
ScrollBar1.Position := Pos;
end;
end;
// Change position when Scroll event happens
procedure TForm1.ScrollBar1Scroll(Sender: TObject;
ScrollCode: TScrollCode; var ScrollPos: Integer);
begin
WPRichText1.TopOffset := Round(ScrollPos / WPRichText1.ScrollVertMultiplicator);
end;
Alles anzeigen