lable显示组合框中的内容
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (this.listBox1.SelectedIndex)
{
case 0:
comboBox1.DropDownStyle=ComboBoxStyle.Simple;
break;
case 1:
comboBox1.DropDownStyle = ComboBoxStyle.DropDown;
break;
case 2:
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
break;
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
label1.Text = this.comboBox1.SelectedItem.ToString();
}
调试的时候lable没有显示combobox中的内容