above

解决方案 »

  1.   

    窗体创建时
    ComboBox.OnChange:=nil;我这没有Delphi不能写全了
      

  2.   

    procedure TForm1.cmb(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
        sendmessage(cmb.Handle,CB_SHOWDROPDOWN,1,0);
    end;
      

  3.   

    这个不太可能,你只有从它继承把它的OnChange覆盖,写一个新的组件
    unit ERpComboBox1;interfaceuses
      Windows, Messages, SysUtils, Classes, Controls, StdCtrls;type
      TERpComboBox1 = class(TComboBox)
      private
        { Private declarations }
        FOnchange:TNotifyEvent;
      protected
        { Protected declarations }
      public
        { Public declarations }
      published
        { Published declarations }
        property OnChange:TNotifyEvent read FOnchange write FOnchange;
      end;procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('Samples', [TERpComboBox1]);
    end;end.不过照我这样写的组件,以后就再也不会触发OnChange事件了,如果谁有更好的办法,就上来聊聊
      

  4.   

    试过了, 无天的方法不行啊! (前后加了这两句都不行, 仍会触发OnChange事件)
    ComboBox1.OnChange := nil;
    ComboBox1.Text := 'aa';
    ComboBox1.OnChange := nil;
      

  5.   

    我试过,没有问题呀!
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        ComboBox1: TComboBox;
        procedure FormCreate(Sender: TObject);
        procedure ComboBox1Change(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    begin ComboBox1.OnChange:=nil;
    end;procedure TForm1.ComboBox1Change(Sender: TObject);
    begin
      Showmessage('没有实现!');
    end;end.