想当选中下拉框某个值时可写,或某个值时只读
解决方案
1
comboBox1.SelectedIndex = 0;//相似于这样,就可以选中你要的那一项,本人也刚入门,=。=
18
在SelectedIndexChanged事件里判断哪个要只读这时ComboBox.DropDownStyle = ComboBoxStyle.DropDownList;,
否则ComboBox.DropDownStyle = ComboBoxStyle.DropDown;
否则ComboBox.DropDownStyle = ComboBoxStyle.DropDown;
1
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox1.Enabled = false;
}
{
comboBox1.Enabled = false;
}