Detect that an app is smart minimized

  • Thread starter Thread starter FL
  • Start date Start date
F

FL

Hi,

Is there any event in the form to detect that it is smart minimized? I
can't seem to find it in Visual Studio .NET 2003? Thanks!

Francisco
 
There is no specific "Smart Minimize" event. You might be able to use the
Deactivate event, although you have to be aware that it will get fired when
a MessageBox is shown on top of your form as well. Not too long ago we found
in another thread that the order of events differs when a form is smart
minimized. Be aware that this order of events is not documented, thus might
change. Take a look here for that earlier discussion (sorry for the long
link):

http://groups.google.nl/groups?hl=e...soft.public.dotnet.framework.compactframework
 
Thanks. There does not seem to be a reliable way to do that. The
Deactivate event is too shabby (worse, it does not appear in the
WinForms designer). I guess I should set a flag for every messagebox and
check for it in the Deactivate event.

BTW, is there any direct API to get the screen size of the device? As
there are more and more different types of devices, I'd like to have a
generic way of resizing the form to fit to the screen size.

Thanks!
Francisco
 
BTW, is there any direct API to get the screen size of the device?

You should be able to use "Screen.PrimaryScreen.Bounds" to accomplish this.
 
Back
Top