Prevent forms from minimizing with another form

  • Thread starter Kurt Van Campenhout
  • Start date
K

Kurt Van Campenhout

Hi,

I have a form which opens up other forms from the UI (sort of a copy of the
current form to allow more than one view at the same time). This works fine,
but when I minimize the first form, it minimizes all the other forms that
have been spawned from that form as well.

How can I prevent this from happening?

I am using Visual Studio 2005, and I'm writing the application in VB.NET. If
you have code in another .NET language, that shouldn't be a real problem, so
C sharpeners :), feel free !

Thanks for any and all help in advance!

Kind regards,
Kurt

PS: Remove the nospam at the end if you want to reply directly...
 
R

Raaj

Hi,

I have a form which opens up other forms from the UI (sort of a copy of the
current form to allow more than one view at the same time). This works fine,
but when I minimize the first form, it minimizes all the other forms that
have been spawned from that form as well.

How can I prevent this from happening?

I am using Visual Studio 2005, and I'm writing the application in VB.NET. If
you have code in another .NET language, that shouldn't be a real problem, so
C sharpeners :), feel free !

Thanks for any and all help in advance!

Kind regards,
Kurt

PS: Remove the nospam at the end if you want to reply directly...

Kurt,

Minimize and close actions of a form co-relates to such actions
applied to the owner of the form.

You may have to assign the owner of the form's being spawned to the
main form or may be to the parent of the form that is creating these
forms.

public partial class Form2 : Form
{
private void button1_Click(object sender, EventArgs e)
{
Form3 childForm = new Form3();
childForm.Owner = this.ParentForm;
childForm.Show();
}
}

I hope this helps.

Raaj
 
E

Eric Robishaw

You may also have displayed the form using the Show(owner) method with the
calling form passed in.

XyzForm f = new XyzForm();
f.Show(this); //will cause both forms to minimize when the current
form minimizes
f.Show(); //will not
 
R

Raaj

You may also have displayed the form using the Show(owner) method with the
calling form passed in.
XyzForm f = new XyzForm();
f.Show(this); //will cause both forms to minimize when the current
form minimizes
You probably misnterpreted the original post. The question was how to
prevent the child form from minimizing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top