Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleArrange MDI child forms
KeywordsMDI, child form, subform
CategoriesTips 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated