azae Posted February 3, 2005 Posted February 3, 2005 Hello, I am actually want to do validation on combobox. It is like u make user must make choose one of the item from combo box before they procedd to do any other action like UPDATE, SAVE or DELETE. In textbox, we always use IF statement like if (textBox1.text == "") { //promt MsgBox ask user to input return; } So, how we do if it is comboBox. I also welcome anything similar, a least I can figure out an idea thanks Quote
mocella Posted February 3, 2005 Posted February 3, 2005 Depending on how you load up/bind your combobox, you could do a check like: if( cboSomeCombo.SelectedIndex == -1 ) { //do your "nothing was selected" logic here } else { //continue your "good" logic, something was selected } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.