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

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;

 

posted @ 2014-11-25 15:23  不能失败  阅读(427)  评论(0编辑  收藏  举报