Minimizing all Forms together

  • Thread starter Thread starter ebiweb
  • Start date Start date
E

ebiweb

hi all,
I have 3 form (Suppose A,B,C) that all are TOPMOST.
from Form A i invoke( Run) form B ,and then Run C from B .

i need to to minimize the whole project from Form C .
but only form C minimized .

anybody can help me plz?
So thnx.
 
hi all,
I have 3 form (Suppose A,B,C) that all are TOPMOST.
from Form A i invoke( Run) form B ,and then Run C from B .

i need to to minimize the whole project from Form C .
but only form C minimized .

anybody can help me plz?
So thnx.

Hi,

What do you mean by TOPMOST? If you mean a form that overlaps all
other forms, I can't figure how 3 forms can be Top most...

Moty
 
Hi,

What do you mean by TOPMOST? If you mean a form that overlaps all
other forms, I can't figure how 3 forms can be Top most...

Moty


hi,
i mean all of them have TOPMOST =True (properties) .
 
hi all,
I have 3 form (Suppose A,B,C) that all are TOPMOST.
from Form A i invoke( Run) form B ,and then Run C from B .

i need to to minimize the whole project from Form C .
but only form C minimized .

anybody can help me plz?
So thnx.

Hi,

Furthermore,
You can set the owner property of the form that runs the new form but
this causes the last form only to be top most.

Moty
 
C must be set as a Owner of A & B. Then, when you minimize C, A & B
will minimize too.

Sample:

private void FormC_Load(object sender, EventArgs e)
{
Form A = new FormA();
Form B = new FormB();
A.Show(this);
B.Show(this);
}

(e-mail address removed) je napisao/la:
 
Hi,

Miroslav Stampar said:
C must be set as a Owner of A & B. Then, when you minimize C, A & B
will minimize too.

Sample:

private void FormC_Load(object sender, EventArgs e)
{
Form A = new FormA();
Form B = new FormB();
A.Show(this);
B.Show(this);
}

In my experience changing forms ownership can lead to weirds problems to
debug.

Another possible solution is that all forms to provide an event that will
fire when being minimized, you could use an interface:

interface IMinimizeNotify
{
public event EventHandler BeingMinimized;
}

each form will implement it

class A:Form, IMinimize

so when form A create form B it would be like:

B b = new B();
b.BeingMinimized += new EventHandler( minimize_me );

void Miminize_me ...
{
// minimize myself and fire the event if neede
if ( this.BeingMinimized != null)
BeingMinimized( null, null);
}
 
Back
Top