Maarten,
Hi, many thanks for your reply.
Thanks for the pointer to the previous thread--I had looked over that
previously, but it was good to get it back in mind.
So, I have been able to catch the Activate event on my form. Was a wee
bit stumped by this initially as the Visual Studio .NET 2003 Forms
Designer doesn't offer the Activate event as an option when adding
events to the form (and neither does it offer the Deactivated event).
I had naively figured that it would allow you to add all the available
events... not to worry.
So, thanks to Katie Schaeffer for pointing out that the Deactivated
event can be used to detect when a form is being "dismissed" or "smart
minimized" or even having a message box pop up in front of it. My
understanding is that the Deactivated event can be used to detect when
the form is being removed from teh top of the Z order.
And thanks to Maarten for pointing out that the Activate event can be
used to detect when the form is being brought back to the front of the
Z order. I cn indeed use this to tell when the form is being "brought
back."
However, as Vinay and Christoph have, I think, pointed out, it is
still pretty difficult to tell the difference between:
1) a form being deactivated because another form is being displayed on
top of the current one,
2) a form is being deactivated because a MessageBox is being displayed
on top of it, and
3) a form is being deactivate because the OS is Smart Minimizing it.
(For some of us, it is this third scenario which is particularly
important.)
Katie did suggest using the Enabled property of the form being
deactivated to determine whether the form was being deactivated
because of a Smart Minimize or not, but I could not see any difference
of value in the Enabled property in the three scenarios above.
Neither can I tell the difference between:
4) a form being activated because it has just been created at the top
of the Z order,
5) a form being activated because a form or MessageBox that was on top
of it has just been dismissed, or
6) a form has just been activated because the application has just
been "restored" after a "Smart Minimize".
Is there a way to tell the difference in these situations?
Katie has suggested that the MinimizeBox be st to false, thereby
changing the (x) Smart Minimize button into a form-closing (ok)
button. This is potentially a solution for some Pocket PC apps, but
not one that has to comply with the "Designed For Windows Mobile" logo
requirements. It would be really handy if Microsoft provided sample
techniques for situations that are stipulated by their logo
requirements, rather than being proscriptive ("thou shalt not...") and
not providing a solution to business requirements.
So, I am still looking for a definitve solution...
Cheers,
Jon
------------
"Maarten Struys, eMVP" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Take a look at this discussion, it might help you further:
> http://groups.google.nl/groups?hl=en....phx.gbl#link1. A
> combination of the events / properties that are mentioned in the discussion
> should be enough to determine if you are smart minimized or if you are
> temporary disabled because a modal dialog box is displayed. Oh one thing
> that is not answered in it is the actual event that you get when being
> re-activeated. It is the activated event. Hope this helps.
>
> --
> Regards,
>
> Maarten Struys, eMVP
> PTS Software bv
>