1. Add control applicationevents
2. Add the following methods to the message event of this space
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);begin
//窗体的滚动条响应鼠标滚轮
if Msg.message = WM_MOUSEWHEEL then
begin
if self.Visible then
begin
if Msg.wParam >0 then
begin
self.VertScrollBar.Position := self.VertScrollBar.Position - self.VertScrollBar.increment;
end
else
begin
self.VertScrollBar.Position := self.VertScrollBar.Position + self.VertScrollBar.increment;
end;
Handled := True;
end
else
Handled := false;
end;
end;