LZ看下是否你想要的
两个下拉框,限定了1 2没限定
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
ComboBox2: TComboBox;
procedure FormMouseWheel(Sender: TObject;
Shift: TShiftState;
WheelDelta: Integer;
MousePos: TPoint;
var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormMouseWheel(Sender: TObject;
Shift: TShiftState;
WheelDelta: Integer;
MousePos: TPoint;
var Handled: Boolean);
begin
if self.ActiveControl is TCombobox then
begin
if self.ActiveControl.Name <> 'ComboBox1' then
exit;
Handled:=true;
if WheelDelta<0 then
Combobox1.Perform(WM_VSCROLL,SB_LINEDOWN,0)
else
Combobox1.Perform(WM_VSCROLL,SB_LINEUP,0);
end;
end;
end.