How to Arrange MDI child forms
Posted on November 20, 2011
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 'Forms - How to Arrange MDI child forms '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 |