我有3个值:1,2,3用增加项的方式放到combobox里我想让我的WinForms窗体在打开时 commbobox里就显示1 并且是只读的 就是不许用户修改combobox里面的值 请问该怎么搞啊

解决方案 »

  1.   

    commbobox.Item.Add("1");
    commbobox.Item.Add("2");
    commbobox.Item.Add("3");
    commbobox.Enabled=false;
      

  2.   


    comboBox1.Text = "1";
    comboBox1.Enabled = false;
      

  3.   

    this.comboBox1.DropDownStyle=System.Windows.Forms.ComboBoxStyle.DropDownList;
      

  4.   

    commbobox1.Item.Add("1"); 
    commbobox1.Item.Add("2"); 
    commbobox1.Item.Add("3"); this.comboBox1.DropDownStyle=System.Windows.Forms.ComboBoxStyle.DropDownList;
      

  5.   

    把它的dropdownstyle属性值设为dropdownlist
      

  6.   

    commbobox1.Item.Add("1"); 
    commbobox1.Item.Add("2"); 
    commbobox1.Item.Add("3"); 
    this.comboBox1.DropDownStyle=ComboBoxStyle.DropDownList;