Title | Arrange MDI child forms |
Keywords | MDI, child form, subform |
Categories | Tips and Tricks, Controls |
|
|
Use the MDI form's Arrange method passing it a parameter to indicate how you want the child forms arranged.
|
|
Private Sub mnuWindowArrangeIcons_Click()
Me.Arrange vbArrangeIcons
End Sub
Private Sub mnuWindowCascade_Click()
Me.Arrange vbCascade
End Sub
Private Sub mnuWindowTileHorizontal_Click()
Me.Arrange vbTileHorizontal
End Sub
Private Sub mnuWindowTileVertical_Click()
Me.Arrange vbTileVertical
End Sub
|
|
Provide other functions for all child forms by looping through the Forms collection.
|
|
Private Sub mnuWindowCloseAll_Click()
Dim frm As Form
For Each frm In Forms
If Not (frm Is Me) Then
Unload frm
End If
Next frm
End Sub
Private Sub mnuWindowMinimizeAll_Click()
Dim frm As Form
For Each frm In Forms
If Not (frm Is Me) Then
frm.WindowState = vbMinimized
End If
Next frm
End Sub
Private Sub mnuWindowRestoreAll_Click()
Dim frm As Form
For Each frm In Forms
If Not (frm Is Me) Then
frm.WindowState = vbNormal
End If
Next frm
End Sub
Private Sub mnuWindowNewWindow_Click()
Dim frm As New Form1
frm.Show
End Sub
|
|
|
|