Hi,
"Miroslav Stampar" <mi**************@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
>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);
}