win编程的一个问题求教:
win程序:要求绑定comboBox后,立刻修改index为0的值;
我下面的代码是曲线救国,有更好的办法吗?
//comboBox1.DataSource = ItemObject ; 不用绑定方式,用添加的方式,“手工绑定”
System.Object[] ItemObject = new System.Object[10];
for (int i = 0; i <= 9; i++)
{
ItemObject[i] = "Item" + i;
}
comboBox1.Items.AddRange(ItemObject);
//修改 = 删除 + 新增
comboBox1.Items.RemoveAt(0);
comboBox1.Items.Insert(0, "Copenhagen");