请问如果我把tcombobox的style属性设置csdropdown
接着我对该控件赋值如下:
combobox1.text:='123';但是我在程序界面上我想使combobox不可编辑。程序里面可以对其text进行赋值。
请问应该怎么办???搞不定哦!!!有其他方法也行,只要实现   在程序界面上使combobox不可编辑。程序里面可以对其text进行赋值。 谢谢!!!

解决方案 »

  1.   

    procedure TForm1.ComboBox1KeyPress(Sender: TObject; var Key: Char);
    begin
      key:=#0;
    end;
      

  2.   


    你好!我如果不想要看到tcombobox的鼠标的光标呢??? 怎么设置?? 谢谢
      

  3.   

    enabled:=false;  那请问这控件的列表还怎么选择
      

  4.   

    设为csDropDownList,参考下面
    ComboBox1.Items.Strings[ComboBox1.ItemIndex] := 'aaaaaa';
    ComboBox1.ItemIndex := ComboBox1.Items.IndexOf('aaaaaa');
      

  5.   

    设置tcombobox的style属性为csdropdownlist
    然后赋值试一下。
    ComboBox1.Items.Add('111');
    ComboBox1.ItemIndex:=0;
      

  6.   

    try this:
    ComboBox1.Items.Add('123');
    ComboBox1.ItemIndex:=0;