[2005] How to determine which event has triggered a handler
Code:
Private Sub cboBuilding_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboBuilding.SelectedIndexChanged, cboBuilding.LostFocus
End Sub
What can I do in the above procedure, which handles two of a combo box's events, to determine which event has called it?
Re: [2005] How to determine which event has triggered a handler
Check if selected index is changed from the previous value then cboBuilding.SelectedIndexChanged is fired otherwise lost focus event is fired.
Re: [2005] How to determine which event has triggered a handler
You're suggesting I have a static variable in the procedure to remember the previous index? Thanks, this would work, but I'm sure there must be a way of finding out which event is being handled.
Obviously I could also write two separate handlers, one to handle each event...
I don't understand how EventArgs contains no information about the event.