How can I minimize all my forms??

tonhinbm

Member
Joined
Apr 13, 2005
Messages
8
Programming Experience
Beginner
I have an aplication with many forms.
I always show forms with showDialog() method.
I would minimize all my opened forms when I minimize the last form open.
How can I do it???
Thanks.
 
If I understand correctly, you are opening a series of forms using the showdialog method each time so that you can only have the last form opened receive input?
By default if you minimize that lst form all other forms minimize as well.
 
First of all thanks for reply me.

I dont't know what are default options that you are telling, but when I open a form2 with showDialog() from another form1, if I minimized form2, the form1 still in his normal state, it doesn't minimaze by default.
Sorry for my poor English, I'm from Galicia.
 
i think you could do this in the LocationChanged event of form2:
VB.NET:
If Me.WindowState = State.Minimized Then
  Me.Parent.WindowState = State.Minimized
Else
  Me.Parent.WindowState = State.Normal
End If

this code may not be correct as i dont have the VS IDE on this system, but the logic is there...
 
The code is very simple.

I have 2 or more window forms.From form1 I open with showDialog() form 2, and from form2 I open with showDialog form3......
VB.NET:
class Form1 :[color=#0000ff]System.Windows.Forms[/color]{
 
.....
 
private void button1_Click(object sender, System.EventArgs e)
{
		 Form2 f2 = new Form2();
		 f2.showDialog();

}
}
 
class Form2 :[color=#0000ff]System.Windows.Forms[/color]{
 
.....
 
private void button1_Click(object sender, System.EventArgs e)
{
		 Form3 f3 = new Form3();
		 f3.showDialog();

}
}

class Form3 :[color=#0000ff]System.Windows.Forms[/color]{
 
.....
 
}
When I minimize form3 I want minimize form2, and form1 too.
I have an aplication with many forms.When I minimize one, the last beacause all are modals, I want minimize all my other forms.
Is there any way to do it???
Thanks.
 
Oh, I see. You're using C# it seems. I don't use C# so I'm not sure how it reacts in this situation. Using VB.NET if you minimize the last modal form, all other forms minimize as well. Perhaps someone else who is familiar with C# could help.
 
Yes dude it IS C# code that's for sure but, i'm afraid i can't be of help here as above all i don't get his idea. Mostly because i don't see any reason for using soooo many modal forms at once (btw, i think that's the main problem here: he is not able to reach rest of the modal forms but rather he is able to reach only one). Maybe if he better explains the idea we can help him in another way?

Regards ;)
 
Back
Top