"Rachel Suddeth" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):
> Hi,
>
> I have a singleton calculator form, that can be displayed
> (non-modal) from any number of places in my ap (either by button
> clicks or special keypresses.) We did it this way because it has
> some special features that involve saving state, and it seemed
> easiest to just keep the thing around since we'll never want
> more than one open at a time. The code to display it currently
> looks like this:
>
> public static void ShowPopup()
> {
> if(PopupCalculator != null)
> {
> PopupCalculator.Activate();
> }
> else
> {
> PopupCalculator = new SpecialCalculator();
> PopupCalculator.Show();
> }
> }
>
> The problem with this is that if the Calculor form is minimized,
> we'd like the ShowPopup() to unminimize it. Right now the call
> to Activate() is just highlighting the taskbar icon. Anyone know
> how to force it to unminimize in code?
Rachel,
Set the window state to "Normal" before activating it:
PopupCalculator.WindowState = FormWindowState.Normal;
PopupCalculator.Activate();
--
Hope this helps.
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/