mdiparent.frm

来自「Visual Basic 6 大学教程的代码」· FRM 代码 · 共 82 行

FRM
82
字号
VERSION 5.00
Begin VB.MDIForm mdiParent 
   BackColor       =   &H8000000C&
   Caption         =   "Fig. 11.10: MDI"
   ClientHeight    =   4200
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   5325
   LinkTopic       =   "MDIForm1"
   StartUpPosition =   3  'Windows Default
   Begin VB.Menu mnuFile 
      Caption         =   "File"
      Begin VB.Menu mnuExit 
         Caption         =   "E&xit"
      End
   End
   Begin VB.Menu mnuWindow 
      Caption         =   "Window"
      Begin VB.Menu mnuJava 
         Caption         =   "Java"
      End
      Begin VB.Menu mnuCpp 
         Caption         =   "C++"
      End
      Begin VB.Menu mnuC 
         Caption         =   "C"
      End
      Begin VB.Menu mnuSeparator 
         Caption         =   "-"
      End
      Begin VB.Menu mnuItem 
         Caption         =   "Cascade"
         Index           =   0
      End
      Begin VB.Menu mnuItem 
         Caption         =   "Tile Horizontal"
         Index           =   1
      End
      Begin VB.Menu mnuItem 
         Caption         =   "Tile Vertical"
         Index           =   2
      End
   End
End
Attribute VB_Name = "mdiParent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 11.10
' Creating and using MDI
Option Explicit      ' General declaration mdiParent

Private Sub MDIForm_Load()
   Call Load(frmForm3)     ' Load child frmForm3
   Call Load(frmForm2)     ' Load child frmForm2
   Call Load(frmForm1)     ' Load child frmForm1
End Sub

Private Sub mnuItem_Click(Index As Integer)
   Call mdiParent.Arrange(Index)  ' Arrange children
End Sub

Private Sub mnuC_Click()
   Call frmForm1.Show    ' Show child frmForm1
End Sub

Private Sub mnuCpp_Click()
   Call frmForm2.Show    ' Show child frmForm2
End Sub

Private Sub mnuJava_Click()
   Call frmForm3.Show    ' Show child frmForm3
End Sub

Private Sub mnuExit_Click()
   Call Unload(frmForm1) ' Unload child frmForm1
   Call Unload(frmForm2) ' Unload child frmForm2
   Call Unload(frmForm3) ' Unload child frmForm3
   End                   ' Terminate execution
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?