This is probably a simple solution. I have a combobox that holds a list of products. Under certain conditions a change of product can effect the form, and I prompt the user for confirmation:
However, when they hit No even though the code did not run, the comboox still holds the new value.
How do I actually prevent the combobox value from changing? Perhaps there is a different event I should use, or is there a PreviousValue method, or something like that?
Thanks a bunch.
Code:
Private Sub cboProduct_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboProduct.SelectedIndexChanged
Dim changeConfirm As DialogResult
changeConfirm = MessageBox.Show("Are you sure?",, _
MessageBoxButtons.YesNo)
If changeConfirm = DialogResult.Yes Then
' run code
End If
End Sub
How do I actually prevent the combobox value from changing? Perhaps there is a different event I should use, or is there a PreviousValue method, or something like that?
Thanks a bunch.