4
Reply

Order Break Between Model And Main Forms

mahesh waghela

mahesh waghela

Nov 1 2012 10:31 AM
2.3k

I have two forms  form1 is main form and form two is model form I want to set the forms as below

 

Form1

private void button1_Click(object sender, EventArgs e)

{

            Form2 f2 = new Form2();
            f2.Show(this);
          
}

 

The above would set the form1 owner of form2 and form2 would be shown but the problem is that this will break the order of forms on press of Alt+Tab keys hence I have tried it with another way as below.

private void button1_Click(object sender, EventArgs e)

{

            Form2 f2 = new Form2()
    f2.ShowDialog(this);          

}

 

This would be works but the problem is that the dialogue forms will not allow me to maximise/minimise and close My form2 is borderless form and it is set to show on specific location as to fit with main form1. My aim to do not shows the form2 in Alt+Tab list and as I close the form2 then form1 will show immediately without break order of form.

When I press Alt+Tab keys on first condition and try to close form2 then the other application shown instead of form1 which is I do not want.

 

Is there any solution of this problem?.


Answers (4)