vbAccelerator - Contents of code file: MultiMenu_mfrmMain.frmVERSION 5.00
Object = "{3D800911-77E3-43DE-82EA-7FC87C713180}#1.0#0"; "cPopMenu6.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.MDIForm mfrmMain
BackColor = &H8000000C&
Caption = "Multi MDI Menu Tester"
ClientHeight = 3690
ClientLeft = 3135
ClientTop = 2505
ClientWidth = 7560
Icon = "mfrmMain.frx":0000
LinkTopic = "MDIForm1"
Begin cPopMenu6.PopMenu ctlPopMenu
Left = 3060
Top = 660
_ExtentX = 1058
_ExtentY = 1058
End
Begin MSComctlLib.ImageList ilsIcons
Left = 0
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 22
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":030A
Key = "NULL"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":0624
Key = "OPEN"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":093E
Key = "SAVE"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":0C58
Key = "PRINT"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":0F72
Key = "CUT"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":128C
Key = "COPY"
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":15A6
Key = "PASTE"
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":18C0
Key = "FIND"
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":1BDA
Key = "BACK"
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":1EF4
Key = "NEXT"
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":220E
Key = "FAVE"
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":2528
Key = "HELP"
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":2842
Key = "NET"
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":2B5C
Key = "FOLDER"
EndProperty
BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":2E76
Key = "DOCUMENT"
EndProperty
BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":3190
Key = "TICK"
EndProperty
BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":34AA
Key = "CASCADEH"
EndProperty
BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":3604
Key = "CASCADE"
EndProperty
BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":375E
Key = "MINIMISE"
EndProperty
BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":38B8
Key = "MAXIMISE"
EndProperty
BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":3A12
Key = "NEXTWIN"
EndProperty
BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "mfrmMain.frx":3B6C
Key = "PREVWIN"
EndProperty
EndProperty
End
Begin VB.Menu mnuFileTOP
Caption = "&File"
Begin VB.Menu mnuFile
Caption = "&New"
Index = 0
End
Begin VB.Menu mnuFile
Caption = "-"
Index = 1
End
Begin VB.Menu mnuFile
Caption = "E&xit"
Index = 2
End
End
Begin VB.Menu mnuHelpTOP
Caption = "&Help"
Begin VB.Menu mnuHelp
Caption = "&Contents..."
Index = 0
End
Begin VB.Menu mnuHelp
Caption = "&Search for Help On..."
Index = 1
End
Begin VB.Menu mnuHelp
Caption = "-"
Index = 2
End
Begin VB.Menu mnuHelp
Caption = "&About"
Index = 3
End
End
End
Attribute VB_Name = "mfrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' This demonstration app demonstrates how to use the
' cPopMenu control to support MDI projects where the
' child forms have their own menus.
Public Sub NewWindow()
Dim f As frmChildMenu
Set f = New frmChildMenu
f.Show
End Sub
Public Sub EndApp()
Dim frm As Form
' Unload all forms:
For Each frm In Forms
If (frm.Name = "frmChildMenu") Then
Unload frm
End If
Next frm
' Unload me:
Unload Me
End Sub
Private Sub ctlPopMenu_NewMDIMenu()
' Whenever you load a form with its own
' menu, this method will be called. Here
' you pass the call onto the form that has
' just been loaded so it can populate
' the icons:
If Not Me.ActiveForm Is Nothing Then
Me.ActiveForm.InitMenu
End If
End Sub
Private Sub MDIForm_Load()
' Set up the MDI forms' menu:
With ctlPopMenu
.SubClassMenu Me
.ImageList = ilsIcons
.ItemIcon("mnuFile(0)") = ilsIcons.ListImages("DOCUMENT").Index - 1
End With
End Sub
Private Sub mnuFile_Click(Index As Integer)
Select Case Index
Case 0
NewWindow
Case 2
Unload Me
End Select
End Sub
|
|