VBI 64.PNG

To create MDI Notepad, follow the following step –

  • (i) Open a new project in visual basic.
  • (ii) Select project menu and choose MDI form to create the container form.
  • (iii) Insert a text box on the form and set the properties of MDI forms, child form in the following format –

Object

Properties

Setting

MDIForm1 Caption Parent Form
Form1 Caption Child Form
  MDIChild True
Text1 MultiLine True
  Text (Empty)
  Left 0
  Top 0
  Height 5000
  Width 5000
  ScrollBars 3-Both

 

  • (iv) Crete menu item to the MDI form as per the specification. Design menu using menu editor dialog box in the following format –

Caption

Name

&File mnFile
…&New mnNew
…E&xit mnExit
&Window mnWindow
…&CasCade mnCascade
…&Tile mnTile

 

  • (v) Double click the New button and write code in the following format –
Private Sub mnNew_Click()
    Dim NewForm As New Form1
    NewForm.Show
End Sub
  • (vi) Double click on Exit button and write code in the following format –
Private Sub mnExit_Click()
    End
End Sub
  • (vii) Double click on Cascade button and write code in the following format –
Private Sub mnCascade_Click()
    MDIForm1.Arrange vbCascade
End Sub
  • (viii) Double click on Tile button and write code in the following format –
Private Sub mnTile_Click()
    MDIForm1.Arrange vbTileHorizontal
End Sub
  • (ix) Select text box on the Form and double click on it. Write code in the code window –
Private Sub Form_Resize()
    Me.Text1.Height = Me.ScaleHeight
    Me.Text1.Width = Me.ScaleWidth
End Sub
  • (x) Now run the application an open multiple document interface using menus.

vbo-64

Advertisements