You are on page 1of 4

simple MDI form This is a simple MDI form demo. It has only one child form.

The child form contains a text box control which looks like a notepad. But this is not a Notepad sample. Opening sa!ing and other facilities of a standard Notepad application are not there. This program is gi!en only to introduce you to MDI form.

The textbox on the child form has scroll bars enabled and the Multi"ine property is set to True. Thus it almost looks like a Notepad. #hen you resi$e the child form the height and width of the textbox control remains as same as those of the child form. The MDI form has a menu bar. It has three menu items % &ile #indow and 'xit. The &ile menu item has a sub menu (New(. On clicking New a new instance of the form is created and displayed. The )lose &ile menu closes only the acti!e form.
----------------------------------------------------------------------------------------------------------------------------------------To open menu Editor Tools Menu Editor Then design the Menu by like this

Check the menu

To give coding for the menu item do the following Click on the menu item u will get Exit ( identifiermnuExit ) menu click event method is mnuExit_Click() Private Sub mnuExit Click!" ##Type the coding here End Sub

Programming Coding : MDIForm Coding:

Private Sub mnu$bout Click!" %orm&'Show End Sub Private Sub mnuClose Click!" (f )ot !$ctive%orm (s )othing" Then *nload $ctive%orm End Sub Private Sub mnuExit Click!" *nload Me End Sub Private Sub mnu)ew Click!" +im frm $s )ew %orm, frm'Show End Sub Private Sub mnu-in Click!(ndex $s (nteger" Select Case (ndex Case . $rrange vbCascade Case , $rrange vbTile/ori0ontal Case & $rrange vbTile1ertical Case 2 $rrange vb$rrange(cons End Select End Sub

Form Coding: Private Sub %orm 3esi0e!" Text,'Move .4 .4 Scale-idth4 Scale/eight End Sub Form! Coding: Private Sub Command, Click!" %orm&'/ide End Sub

"utput:

You might also like