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;

 

你可能感兴趣的:(combobox)