Raised events are called in wrong order.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LeoVBNET
    New Member
    • Apr 2013
    • 29

    Raised events are called in wrong order.

    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 "MdiChildActiva te" occurs before the MDI-child really open or close. In fact, when close() method is called the events raise as follow: 1) MdiChildActivat e 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.MdiChild ren.Length this value is not update.
    Thanks.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    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.

    Comment

    Working...