MdiChildActivate Event... 
Author Message
 MdiChildActivate Event...

Hi,

The MdiChildActivate Event is raising, both on child form Activate and
Closed events - OK, but how we can know in the event handler that, which
event causes this event is raised. I mean Activate or Closed event?

Regards,
...Ashok



Sun, 06 Mar 2005 02:24:54 GMT  
 MdiChildActivate Event...
Hi!

Have a bool variable in place, and set it to false. In the Closing event of
the form, set it to true. Check its value in the MdiChildActivate. If its
true, you know that the form is closing, else its been activated.

--
*************************************************************************
"French is the language of love, C# is for everything else..."



Quote:
> Hi,

> The MdiChildActivate Event is raising, both on child form Activate and
> Closed events - OK, but how we can know in the event handler that, which
> event causes this event is raised. I mean Activate or Closed event?

> Regards,
> ...Ashok



Sun, 06 Mar 2005 14:25:48 GMT  
 MdiChildActivate Event...
Ashok,
  Forms (and windows in general) are pretty agnostic about what causes them
to be activated.  In order to "know" what caused them to become active,
you'd need to write code which perhaps tracks close events for the child
forms OnClosing/OnClosed for you child form class and cache that information
away in the parent form (evaluate and clear this information in the
MdiChildActivate event -- note that deactivation events precede activation
events so this should be safe) -- or track the current of the MdiChildren
collection against a known state when you get the MdiChildActivate event (I
don't like that, personally, since gets expensive).

Matt
VB Team
--
This posting is provided "AS IS" with no warranties, and confers no rights.
(c) copyright Microsoft Corporation 2002


Quote:
> Hi,

> The MdiChildActivate Event is raising, both on child form Activate and
> Closed events - OK, but how we can know in the event handler that, which
> event causes this event is raised. I mean Activate or Closed event?

> Regards,
> ...Ashok



Wed, 09 Mar 2005 04:48:59 GMT  
 MdiChildActivate Event...
Thanks,

The same problem is with MdiChild deactivate event, which is not raising
when a form is deactivated. I tried few solutions given by some on in the
groups but found will not work as they raise multiple times for multiple
forms. The number of child forms get increased the event raise hat many
number of multiple times the event riases. Still I am searching for right
the solution...

Regards,
...Ashok



Quote:
> Ashok,
>   Forms (and windows in general) are pretty agnostic about what causes
them
> to be activated.  In order to "know" what caused them to become active,
> you'd need to write code which perhaps tracks close events for the child
> forms OnClosing/OnClosed for you child form class and cache that
information
> away in the parent form (evaluate and clear this information in the
> MdiChildActivate event -- note that deactivation events precede activation
> events so this should be safe) -- or track the current of the MdiChildren
> collection against a known state when you get the MdiChildActivate event
(I
> don't like that, personally, since gets expensive).

> Matt
> VB Team
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> (c) copyright Microsoft Corporation 2002



> > Hi,

> > The MdiChildActivate Event is raising, both on child form Activate and
> > Closed events - OK, but how we can know in the event handler that, which
> > event causes this event is raised. I mean Activate or Closed event?

> > Regards,
> > ...Ashok



Thu, 10 Mar 2005 01:25:27 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Events, Events, alas, wherefore art thou events...

2. Events, Events, alas, wherefore art thou events...

3. Events, Events, alas, wherefore art thou events...

4. Control Event Problem (Post Event after an event is fired)

5. object created in workbook_open event handler disappears on exit from the event handler

6. Excel events (need shutdown event)???

7. ItemChange event firing off after ItemAdd event

8. Changing non-recurring events to yearly recurring events

9. How do you write a events thats is call before the item_remove events from Outlook

10. SelectionAdded event vs. ShapeAdded event

11. Event before Terminate event?

12. Major bug with Interface Events and Shared Events

 

 
Powered by phpBB® Forum Software