Skip to content

Minimize Windows Form

Sachin Ohri

Asked Mar 25, 2007, 10:59 PM EDT1 answer
Share
LinkedInX
Hi,

I have a windows application, which has a main form and on top of it i have a modal form. i want to minimize both the forms at one shot.
Can anyone provide me details on doing the same.

Thanks

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0

    In .NET, if you are using windows forms, The main form should automatically minimize when you launch the modal dialog (using ShowDialog) and choose minimize.  Below is my test code where TestDialog is simply another Windows Form.

    -Mike


    C#
    namespace TestModal2
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }
    private void button1_Click(object sender, EventArgs e)
    {
    TestDialog dlg = new TestDialog();
    dlg.ShowDialog();
    }
    }
    }
    0