I want to know how to minimize all open forms when i minimize the main form of my project. When there are a couple of forms visible, and i minimize the main form the others stay open. How can i minimize all the forms?
Printable View
I want to know how to minimize all open forms when i minimize the main form of my project. When there are a couple of forms visible, and i minimize the main form the others stay open. How can i minimize all the forms?
Put this inside your main form:
If it is possible, use a MDIform and load other forms as MDIChild. It will solve you from this problem.VB Code:
Private Sub Form_Resize() If Me.WindowState = vbMinimized Then Dim frm As Form For Each frm In Forms If frm.Name <> Me.Name Then frm.WindowState = vbMinimized End If Next End If End Sub
In your main form.
VB Code:
Private Sub Form_Resize() Dim f As Form If Me.WindowState = vbMinimized Then For Each f In Forms If Not (f Is Me) Then f.WindowState = vbMinimized End If Next End If End Sub
thanks, works great!