By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,239 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,239 IT Pros & Developers. It's quick & easy.

Raised events are called in wrong order.

P: 29
Hi.
I noticed that there is some raised events that go through in reverse order. For example...
1) The event "CheckedListBox.ItemCheck" occurs before the item check changed. Fortunately I solve this problem with e.Newvalue and e.CurrentValue.
2) Working with MDI forms the event "MdiChildActivate" occurs before the MDI-child really open or close. In fact, when close() method is called the events raise as follow: 1) MdiChildActivate 2) MDI-child Closing 3) MDI-child Closed. It makes that the MDI-parent form does not know neither who MDI-child raised the event nor if it was opened or closed. So, if you ask for MDI-parent.MdiChildren.Length this value is not update.
Thanks.
Apr 9 '13 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,383
Both your examples of wrong order sound like correct order to me.

I would expect item check to go first before item check change. You have to check it before it changes. It can't change before you check it. So that sounds like the correct order to me.

I also expect the order to be activate, closing, closed. Closing definitely goes before closed. And I don't know why you would think activate would go anywhere after closed. You can't activate it if it's closed.

So all in all, the order of events seem fine to me. I don't know why you think they're in the wrong order.
Apr 9 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.