Skip Navigation Links.
MDI Form Example
Language(s):Visual Basic 6.0
Category(s):MDI

How to write MDI Applications.

' MDI Form Example 

' How to write MDI Applications 

' Jon Vote, Idioma Software Inc. 

' 02/2002 

' www.idioma-software.com
'
' 1) Create a new project. Form1 will be created by default.
' 2) Set the MDIChild property of Form1 to TRUE. 
' 3) From the menu select Project|Add MDI Form
' 4) Add a Picture Box to the MDI Form. 
' 5) Set the Picture Box Height to 645. 
' 6) Set the Picture Box Align property to 2 - Align Bottom
' 7) Place four Command Buttons on the Picture Box. 
'    Note you can not place them on the MDI Form - they must 
'    be placed on a Picture Box or other container control. 
' 8) From the menu select Project|Properties. 
' 9) Set the Startup Object to MDIForm1.
'10) Paste the following code into the declarations section of MDIForm1:

' --- Begin code for MDIForm1

Option Explicit

Const ARRANGE_CASCADE = 0
Const ARRANGE_HORIZONTAL = 1
Const ARRANGE_VERTICLE = 2

Private Sub Command1_Click()
  
  Dim frmForm
  
  Set frmForm = New Form1
  frmForm.Show
  
End Sub

Private Sub Command2_Click()
  Me.ARRANGE ARRANGE_HORIZONTAL
End Sub

Private Sub Command3_Click()
  Me.ARRANGE ARRANGE_VERTICLE
End Sub

Private Sub Command4_Click()
  Me.ARRANGE ARRANGE_CASCADE
End Sub

Private Sub MDIForm_Load()
  
  Me.Caption = "MDI Form Example"
  Command1.Caption = "Load"
  Command2.Caption = "Horizontal"
  Command3.Caption = "Verticle"
  Command4.Caption = "Cascade"
  
End Sub

' --- End code for Form1 ---



From: justinhimt - 2014-04-08
Any windows can become an MDI parent, if you set the IsMdiContainer property to True. IsMdiContainer = true; example http://csharp.net-informations.com/gui/cs-mdi-form.htm justin

This article has been viewed 12864 times.
The examples on this page are presented "as is". They may be used in code as long as credit is given to the original author. Contents of this page may not be reproduced or published in any other manner what so ever without written permission from Idioma Software Inc.