ScrollBox 响应鼠标滚轮和ComboBox禁止滚动

时间:2014-11-25 16:08:04   收藏:0   阅读:575
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
 if WheelDelta < 0 then
   ScrollBox1.Perform(WM_VSCROLL,SB_LINEDOWN,0)
 else
   ScrollBox1.Perform(WM_VSCROLL,SB_LINEUP,0);
 if ActiveControl is TComboBox then
   if not TComboBox(ActiveControl).DroppedDown Then
     Handled:=True;
end;

 

原文:http://www.cnblogs.com/starluck/p/4121129.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!