| |
|
<Previous lesson | Table
of Content | Content of this Chapter |
Next lesson>
Click here to download the code
- Continue the MDI Form project, in the Project Window, double click
the MDI Form1 to put the MDI Form in front
- In the Menu of VB, click Tools > Menu Editor or you can use
Ctrl-E. The menu Editor will appear.

- In the Caption, type &File then in the name, type mnuFile then
click Next button
- In the Caption, type &Exit then in the name, type mnuExit then
click right arrow button. In the Shortcut list, choose Ctrl-X, then
Next button
- In the Caption, type &Window then in the name, type mnuWindow
then click the Window List checkbox, and then the Next button.
- In the Caption, type &Calendar then in the name, type mnuCalendar
then click right arrow button. In the Shortcut list, choose Ctrl-L,
then Next button
- In the Caption, type &Controller then in the name, type mnuController
then click right arrow button. In the Shortcut list, choose F6, then
Next button
- The menu editor will be the same as figure on the right. Press
OK
- Now you have menu in the MDI Form, click File>Exit and enter
- In the mnuExit_Click procedure, type
Private Sub mnuExit_Click()
End
End Sub
- In the menu of MDI form, select Window > Controller and click
to wrie the subsequent code
Private Sub mnuController_Click()
If mnuController.Checked = True Then
'now is checked, make it unchecked
frmController.Hide
mnuController.Checked = False
Else ' now is unchecked, make it checked
frmController.Show
mnuController.Checked = True
End If
End Sub
- Run the program, and look at the Window menu and try the Exit menu.
<Previous lesson | Table
of Content | Content of this Chapter |
Next lesson>
|
|