|
-
Feb 21st, 2007, 11:29 AM
#1
Thread Starter
Lively Member
[RESOLVED] Minimize all forms when main form is minimized
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?
-
Feb 21st, 2007, 11:33 AM
#2
Re: Minimize all forms when main form is minimized
Put this inside your main form:
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
If it is possible, use a MDIform and load other forms as MDIChild. It will solve you from this problem.
-
Feb 21st, 2007, 11:35 AM
#3
Re: Minimize all forms when main form is minimized
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
-
Feb 21st, 2007, 11:55 AM
#4
Thread Starter
Lively Member
Re: Minimize all forms when main form is minimized
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|