开发者

C# combobox select new item

Is it possible to set the selec开发者_如何学Goted item of a combobox to be an object that is not in its dropdown list?

If yes, then what must one do?


Use the Text property:

comboBox.Text = "I'm not in the list!";

If you want to add the item to the list, use the Items collection:

comboBox.Items.Add("I was added to the list!");


Is there a reason you cannot add it to the list after the object was generated? Is the object generated asynchronously?

myComboBox.Items.Add(newItem);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜