我是在构造函数里面定义的:
comboBox1.Items.Add("123");
comboBox1.Items.Add("456");
         comboBox1.Leave += new EventHandler(this.comboBox1_Leave);

解决方案 »

  1.   

    这个问题我先回答你,然后你找本书看了。在comboBox的SelectedIndexChanged事件处理函数中加入 textBox.Text = comboBox.Text;

            private void comboBox_SelectedIndexChanged(object sender, EventArgs e)
            {
                textBox.Text = comboBox.Text;
            }
      

  2.   

    大哥,要有这行代码的:
    this.comboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);集成环境可以自动生成的啊,晕咯
      

  3.   

    private void Form1_Load(object sender, System.EventArgs e)
    {
    comboBox1.Items.Add("123");
    comboBox1.Items.Add("456");
    comboBox1.SelectedIndexChanged += new EventHandler(comboBox1_SelectedIndexChanged);
    }void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
    textBox1.Text = comboBox1.SelectedItem.ToString();
    }
      

  4.   

    我的怎么没有自动生成?不过我刚用,可能是自己的问题。还有一点:
    textBox4.Text=textBox4.Text+comboBox1.Text;
    我把语句这样修改,本想得到如果textBox4 的text 属性为aaa  而我选择的comboBox1 的text属性为1234 那么选择后,希望结果为aaa1234  但是现在却是 aaa12341234 奇怪
      

  5.   

    我又修改了下,发现,如果不在构造函数里面使用   this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
    就是正确的。