sny23vpb
asked on
Combo Box Event Firing at Load
I have an application such that it has a combo box and when the form is up and loaded; I'd like to call another form when they select an item in the combo box.
I've tried putting the following code in various events (its currently in selectedvaluechange) but no matter where I put it; vb.net opens the form when it first loads without anyone even having an opportunity to see the combo box on the screen much less click on it.
Should I be using a diff event or different code.
Under selectedvaluechange I have
If cboDiscounts.Text Like "*system.data.datarowview* " Or System.Convert.IsDBNull(cb oDiscounts .Text) = True Then
Else
discountentry.ShowDialog()
End If
Basically; by using if system.data.datarowview which I'm not even sure you can use in an expression or isdbnull; I'm trying to tell it that while the form is still loading and the text in the comboxbox is blank; do nothing. Wait for the combo to load and let the user click something then open the form.
No success. yet.
Thanks for anyones help with this !
I've tried putting the following code in various events (its currently in selectedvaluechange) but no matter where I put it; vb.net opens the form when it first loads without anyone even having an opportunity to see the combo box on the screen much less click on it.
Should I be using a diff event or different code.
Under selectedvaluechange I have
If cboDiscounts.Text Like "*system.data.datarowview*
Else
discountentry.ShowDialog()
End If
Basically; by using if system.data.datarowview which I'm not even sure you can use in an expression or isdbnull; I'm trying to tell it that while the form is still loading and the text in the comboxbox is blank; do nothing. Wait for the combo to load and let the user click something then open the form.
No success. yet.
Thanks for anyones help with this !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Form_Load or Form_Activated, assuming that your combobox is fully loaded with values, or bound to a datasource that is fully loaded with values, at that point.
Roger
Roger
are using windows application or web application??
ASKER
windows application in visual studio 2003. Perhaps I'm not looking in the right place. I only see the events for new, finalize, and initialize component. I don't see a form load event. Thanks for your help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
ASKER
Thanks again.