|
-
Aug 30th, 2002, 01:16 PM
#1
Thread Starter
New Member
Order of which reference for same event
If you have multiple references to the same control, how does VB
decide the order of which reference gets the event first?
So, for example: I have a textbox named txtMyText and I implement the textbox's LostFocus event. I also have a member variable: private WithEvents m_txtMyText as TextBox (which references txtMyText) and implement the LostFocus event for this too.
How does VB decide the order of which reference/method/implementation gets the LostFocus event first? Also, is the order guaranteed?
Note: This is a simplified version of what I am doing so it may not
make sense at first as to why I am doing it.
Thanks,
Chad
-
Aug 30th, 2002, 01:55 PM
#2
I believe it is the order in which the references were made but I don't think there are any guarantees to which order they will be in. You could call a method or event from inside another event o ensure it fires in the write order.
I bet Jim knows for sure, he knows everything.
-
Aug 30th, 2002, 03:19 PM
#3
Frenzied Member
Events are really windows messages that are sent to the main window of your app - it has a function, call it a WndProc, which dispatches the messages as they come in. Each control is a window and does the same thing with messages it gets.
COM objects (classes) have these as well.
This is a message queue - when it's over the network it's called a message chain. You need to control it, either way.
Start here in learning about it:
http://msdn.microsoft.com/library/de...Properties.asp
Particularly note: DenySharedReceive which I think you want.
maybe...
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
|