开发者

one simple question about c# combobox

my comboboxes is filling on dropdown i want if user dont select somet开发者_JAVA技巧hing in it and press somewhere or just close dropdown combobox value was null Sorry for my english


if the combo box is opened then closed(for any reason) and the user did not select something, the combobox will have the same value it had before it was opened.

Note: If you are filling the combobox with values from a datasource and you want it to have a null value, then set the selectedIndex of the combobox to -1


Are you asking null control? If yes, you can handle this with these control.

    if(comBox.SelectedIndex == -1)
    {
    MessageBox.Show("Please Select Any Item");
    return;
    }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜