|
-
May 20th, 2008, 04:59 AM
#1
Thread Starter
Frenzied Member
[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?
This world is not my home. I'm just passing through.
-
May 20th, 2008, 05:16 AM
#2
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.
-
May 20th, 2008, 05:21 AM
#3
Thread Starter
Frenzied Member
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.
This world is not my home. I'm just passing through.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|