Form Minimize

B

Brian Patterson

I have an application with a main form (FormA). This form is borderless
because we have a lot of skin action going on. The form creates and
displays a second form (FormB) via formB.Show(). When we minimize FormA it
also minimizes FormB. Is there any way to prevent this? I have played
around with CreateParams with no luck.

TIA!
Brian
 
M

Marc Gravell

This is the default behaviour when ownership is specified (as illustrated by
example below); so - do you really need the ownership, or can it be managed
else-wise?

static void Main(string[] args)
{
Form x = new Form();
x.Text = "Parent x";
Form y = new Form();
y.Text = "Child y";
y.Owner = x;
x.Show();
y.Show();
Form a = new Form();
a.Text = "Unrelated a";
Form b = new Form();
b.Text = "Unrelated b";
a.Show();
b.Show();
Form app = new Form();
app.Text = "Kill app";
Application.Run(app);
}
 
B

Brian Patterson

That is exactly my problem. I am not setting any owner information. If I
set a breakpoint in the constructor of my FormB - and view the Owner and
Parent properties - they are both null.

Ideas?

Brian Patterson
Marc Gravell said:
This is the default behaviour when ownership is specified (as illustrated
by example below); so - do you really need the ownership, or can it be
managed else-wise?

static void Main(string[] args)
{
Form x = new Form();
x.Text = "Parent x";
Form y = new Form();
y.Text = "Child y";
y.Owner = x;
x.Show();
y.Show();
Form a = new Form();
a.Text = "Unrelated a";
Form b = new Form();
b.Text = "Unrelated b";
a.Show();
b.Show();
Form app = new Form();
app.Text = "Kill app";
Application.Run(app);
}

Brian Patterson said:
I have an application with a main form (FormA). This form is borderless
because we have a lot of skin action going on. The form creates and
displays a second form (FormB) via formB.Show(). When we minimize FormA
it also minimizes FormB. Is there any way to prevent this? I have played
around with CreateParams with no luck.

TIA!
Brian
 
M

Marc Gravell

To be honest, there's not a lot to go on without some kind of illustrative
code here: for instance, what is the respecitve modality of the forms? Are
you using .Show, .ShowDialog, or Application.Run, etc? How the forms are
being created? disposed?

Marc
Brian Patterson said:
That is exactly my problem. I am not setting any owner information. If I
set a breakpoint in the constructor of my FormB - and view the Owner and
Parent properties - they are both null.

Ideas?

Brian Patterson
Marc Gravell said:
This is the default behaviour when ownership is specified (as illustrated
by example below); so - do you really need the ownership, or can it be
managed else-wise?

static void Main(string[] args)
{
Form x = new Form();
x.Text = "Parent x";
Form y = new Form();
y.Text = "Child y";
y.Owner = x;
x.Show();
y.Show();
Form a = new Form();
a.Text = "Unrelated a";
Form b = new Form();
b.Text = "Unrelated b";
a.Show();
b.Show();
Form app = new Form();
app.Text = "Kill app";
Application.Run(app);
}

Brian Patterson said:
I have an application with a main form (FormA). This form is borderless
because we have a lot of skin action going on. The form creates and
displays a second form (FormB) via formB.Show(). When we minimize FormA
it also minimizes FormB. Is there any way to prevent this? I have
played around with CreateParams with no luck.

TIA!
Brian
 

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