Combo Box - Scrolling up with Mouse Wheel causes Error
When using the mouse wheel to scroll through a combobox that has been
filled and a value has been pre-selected, I receive the error
"ArgumentOutOfRangeException". The error message for Visual Studio is
showing up in a place that is obviously wrong, however. What could be
causing this?
This occurs in a "SelectedIndexChanged event":
private void cbCat2_SelectedIndexChanged(object sender, EventArgs e)
{
if (cbCat2.SelectedIndex <= 0)
{
if (cbJobCode.Items.Count > 0)
cbJobCode.SelectedIndex = 0;
cbJobCode.Items.Clear();
cbJobCode.Enabled = false;
btnJobCodeDown.Enabled = false;
}
}
No comments:
Post a Comment