locked
How do you Show a minimized form? RRS feed

  • Question

  • How do you Show a form in such a way that it appears, even if it has been minimized with "-"?

     

    In detail: Suppose I have Form1 and Form2 in Visual Basic within Visual Studio .NET 2008.  If in Form1 I say Form2.Show(), it shows just fine.  Similarly, if I say Form2.Hide(), it hides just fine.  If I have a toggle that alternately does Form2.Show() and Form2.Hide(), the form alternately shows and hides.

     

    However, if I have clicked the "-" in the upper right control box, and have minimized Form2 first, instead of "showing", the form alternately toggles in and out of the minimization tabs along the bottom of the PC screen.  The user expects that even if Form2 is minimized, the "show" toggle will bring it to the screen.

     

    It seems it must take undoing Form2's minimization, but I don't see a way to do this.

     

    Can anyone help?

    Tuesday, January 15, 2008 8:02 PM

Answers

  • Not really!

    Even though you minimize the form to the taskbar by hitting the "-" the form is still shown! That means you can't re-show a form which is already active!

     

    However,

    you can get your Form 2 back by setting its WindowState back to normal:

     

    Code Block

    Form2.WindowState = FormWindowState.Normal

     

     

    Tuesday, January 15, 2008 8:41 PM

All replies

  • Not really!

    Even though you minimize the form to the taskbar by hitting the "-" the form is still shown! That means you can't re-show a form which is already active!

     

    However,

    you can get your Form 2 back by setting its WindowState back to normal:

     

    Code Block

    Form2.WindowState = FormWindowState.Normal

     

     

    Tuesday, January 15, 2008 8:41 PM
  • Thank you very much.  That was the statement I needed.  I added it to the toggle, and the toggle now shows the form maximized, even if the user had minimized it before toggling and expecting to see the form.

     

     

     

    Tuesday, January 15, 2008 9:10 PM