I found some code that works to validate a combobox in VB.NET 2008. However, the MessageBox keeps popping up over and over. It seems that the Enter key I use to close it fires the event over again, so I am in a loop. How can I turn off the loop?
I also tried PreviewKeyDown, which makes the box appear only twice, which is better, but still not great.
If e.KeyCode = Keys.Enter Then
If CUST_IDComboBox.FindStringExact(CUST_IDComboBox.Text) = -1 Then
MessageBox.Show("You entered an Invalid Number!")