How can the number of lines scrolled be changed from 3 to 1?
I tried the code below, but it increments the TopIndex by 3 as well as by my 1; i.e. making Handled := True doesn't stop the default behaviour. Is this a bug? Please explain.
Also, this event is called twice, so the increment is actually 5. I can work around this by setting a Boolean variable the first time and testing and resetting the 2nd time, but is this expected behaviour or a bug?
Thanks.
Raymond
procedure TMainForm.ItemTreeMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
with ItemTree do
begin
TopIndex := TopIndex - System.Math.Sign(WheelDelta);
end;
Handled := True;
end;
Comments