在FormMouseWheel添加事件就可以了:
1 2 3 4 |
|
procedure TForm1.FormMouseWheel(Sender: TObject; Shift:TShiftState;WheelDelta: Integer; MousePos: TPoint; var Handled:Boolean);
begin
VertScrollBar.Position:= VertScrollBar.Position -WheelDelta ;//如果你想要速度慢点的话用VertScrollBar.Position -(WheelDelta div 10)
end;
本文介绍了一种通过在Delphi中为窗体添加FormMouseWheel事件来控制垂直滚动条的方法。当用户滚动鼠标滚轮时,此事件将被触发,并调整滚动条的位置。

224

被折叠的 条评论
为什么被折叠?



