I have some logic being handled in the Validated
event on a combobox, but would like it to trigger as soon as a selection is made. I can handle the SelectedIndexChanged
event separately in order to fire the event, but I'm not sure how to invoke it.
Private Sub ComboSelectedIndexChanged(sender As System.Object, e As System.EventArgs) _
Handles ComboBox1.SelectedIndexChanged
'Fire Validated Event
End Sub
Private Sub ComboValidated(sender As System.Object, e As System.EventArgs) _
Handles ComboBox1.Validated
'Do Something Here
End Sub
I'd rather not call into the method handling the validated event directly,
<!-- language: lang-vb -->ComboValidated(Nothing, Nothing)
as it's not precisely what I'm trying to do with the code and it will run a second time when in fact the validated event actually does fire upon losing focus.
What code can I execute to fire the validated event (either by fire the event directly or by causing the control to lose focus)?