ComboBox empty text => index 0

Easier clearing of values; instead of saying "stuff is wrong", it's
obvious the user deleted the text so just set it to the 0th item.
This commit is contained in:
Kaphotics
2016-03-05 16:59:16 -08:00
parent e9a85e8a88
commit ff64a875fc

View File

@@ -2060,6 +2060,8 @@ private void validateComboBox(object sender)
ComboBox cb = (ComboBox)sender;
cb.SelectionLength = 0;
if (cb.Text == "")
{ cb.SelectedIndex = 0; return; }
cb.BackColor = cb.SelectedValue == null ? Color.DarkSalmon : defaultControlWhite;
}
private void validateComboBox(object sender, EventArgs e)