DELPHI ScrollBox1響應鼠標滾輪和ComboBox禁止滾動

DELPHI  ScrollBox1響應鼠標滾輪和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;
spa

#Delphi orm

相關文章
相關標籤/搜索