高手们都帮帮忙,我很着急,现在不想让他响应滚轮事件,可是不知道TComboBox有哪个属性可以控制阿?大哥大姐们,救救我吧!

解决方案 »

  1.   

    procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
      WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
    begin
      Handled := True;
    end;
      

  2.   

    上面的例子把所有该窗体的鼠标滚轮都禁止了,也可以自己写控件或类,简单举例如下:
    type
      TMyCombobox = class(TCombobox)
      public
        property OnMouseWheel;
      end;var
      Form1: TForm1;
      Combobox1 :TMyCombobox;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    begin
      Combobox1 := TMyCombobox.Create(nil);
      Combobox1.Parent := Self;
      Combobox1.Items.Add('1');
      Combobox1.Items.Add('2');
      Combobox1.Items.Add('3');
      Combobox1.Items.Add('4');
      Combobox1.Items.Add('5');
      Combobox1.Items.Add('6');
      ComboBox1.OnMouseWheel := MyComboboxMouseWheel;
    end;procedure TForm1.FormDestroy(Sender: TObject);
    begin
      Combobox1.Free;
    end;procedure TForm1.MyComboboxMouseWheel(Sender: TObject; Shift: TShiftState;
      WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
    begin
      Handled := True;
    end;
      

  3.   

    用楼上的办法。当然,也可以选择支持滚轮的控件或者开发工具。。好像turbo delphi就可以