Professional Documents
Culture Documents
Project -> Add MDI form., a project can have only one MDI form.
2.
You can't place most controls on an MDI form. The only controls that can
be placed on the surface of the MDI form are Menus, Timer,
CommonDialog, PictureBox, ToolBar, and StatusBar.
MDI child form: To add a child form, you have to add a regular form,
and set the MDIchild property to True. You can have many child forms and can
show an MDI child form using the Show method.
AutoShowChildren property of an MDI form: The default value of
the AutoShowChildren property is True. When it is True, the MDI child forms are
displayed once they are loaded. When the value is False only then you can keep
it hidden after loading, otherwise not.
Restrictions of the MDI child forms:
1. You can't display an MDI child form outside its parent.
2. You can't display a menu bar on the MDI child form.
Example:-
Code:
'Inside the MDI form module
Private Sub mnuCascade_Click(Index As Integer)
Arrange vbCascade
End Sub
Private Sub mnuClose_Click()
If Not (ActiveForm Is Nothing) Then Unload ActiveForm
End Sub
Private Sub mnuExit_Click()
Unload Me
End Sub
Private Sub mnuNew_Click()
Dim frm As New Form1
frm.Show
End Sub
Private Sub mnuWin_Click(Index As Integer)
Select Case Index
Case 0
Arrange vbCascade
Case 1
Arrange vbTileHorizontal
Case 2
Arrange vbTileVertical
Case 3
Arrange vbArrangeIcons
End Select
End Sub
'Inside the child form module
Private Sub Form_Resize()