Currently I'm in the middle of making a small app in c# that requires the user to make a selection of an object using a combo box, from there the user can edit properties of that object below and then save them to a database.
I'm having an issue though when trying to ask the user whether they would like to cancel when they click on the combo box again but have changes to save.
the best I have is below, but users can still use a keyboard to select items even when the drop down height means they can't see the options.
private void cmbBooks_DropDown( object sender, EventArgs e )
{
if ( CheckSave( ) ) //checksave returns true if they want to cancel
{
cmbBooks.DropDownHeight = 1;
}
}
thanks
EDIT I've tried it with the SelectedIndexChanged event and from there I can stop the box carrying on and opening that object but then the combo box would stay selecting the object they tried to select and the combo box still stays open?
SelectedIndexChanged
event help ? – V4Vendetta.SelectedIndex
back to the previous value if they cancel. – Ash Burlaczenko