?? 菜單_動(dòng)態(tài)f.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "動(dòng)態(tài)菜單"
ClientHeight = 3090
ClientLeft = 165
ClientTop = 855
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Menu mnuAPP
Caption = "可執(zhí)行文件"
Begin VB.Menu mnuEXE
Caption = "待執(zhí)行文件"
Begin VB.Menu mnuEXEfile
Caption = ""
Index = 0
Visible = 0 'False
End
Begin VB.Menu mnuEXEfile
Caption = "項(xiàng)目1"
Index = 1
End
Begin VB.Menu mnuEXEfile
Caption = "項(xiàng)目2"
Index = 2
Visible = 0 'False
End
Begin VB.Menu mnuEXEfile
Caption = "項(xiàng)目3"
Index = 3
Visible = 0 'False
End
Begin VB.Menu mnuEXEfile
Caption = "項(xiàng)目4"
Index = 4
Visible = 0 'False
End
Begin VB.Menu mnuEXEfile
Caption = "項(xiàng)目5"
Index = 5
Visible = 0 'False
End
End
Begin VB.Menu mnuADD
Caption = "增加待執(zhí)行文件"
Begin VB.Menu mnuADDfile
Caption = ""
Index = 0
Visible = 0 'False
End
Begin VB.Menu mnuADDfile
Caption = "項(xiàng)目1"
Index = 1
Visible = 0 'False
End
Begin VB.Menu mnuADDfile
Caption = "項(xiàng)目2"
Index = 2
End
Begin VB.Menu mnuADDfile
Caption = "項(xiàng)目3"
Index = 3
End
Begin VB.Menu mnuADDfile
Caption = "項(xiàng)目4"
Index = 4
End
Begin VB.Menu mnuADDfile
Caption = "項(xiàng)目5"
Index = 5
End
End
Begin VB.Menu mnuDEL
Caption = "刪除待執(zhí)行文件"
Begin VB.Menu mnuDELfile
Caption = ""
Index = 0
Visible = 0 'False
End
Begin VB.Menu mnuDELfile
Caption = "項(xiàng)目1"
Index = 1
End
Begin VB.Menu mnuDELfile
Caption = "項(xiàng)目2"
Index = 2
Visible = 0 'False
End
Begin VB.Menu mnuDELfile
Caption = "項(xiàng)目3"
Index = 3
Visible = 0 'False
End
Begin VB.Menu mnuDELfile
Caption = "項(xiàng)目4"
Index = 4
Visible = 0 'False
End
Begin VB.Menu mnuDELfile
Caption = "項(xiàng)目5"
Index = 5
Visible = 0 'False
End
End
End
Begin VB.Menu mnuExit
Caption = "退出"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim intC As Integer
Const filenumber = 5 '項(xiàng)目個(gè)數(shù)
Private Sub Form_Load()
intC = filenumber
End Sub
Private Sub mnuADDfile_Click(Index As Integer)
'從mnuADDfile菜單數(shù)組中移走項(xiàng)目,添加到mnuEXEfile數(shù)組中
If intC <= 2 Then
MsgBox "必須保留一個(gè)項(xiàng)目,不能再移走!"
Exit Sub
End If
mnuDELfile(Index).Visible = True
mnuEXEfile(Index).Visible = True
mnuADDfile(Index).Visible = False
intC = intC - 1
End Sub
Private Sub mnuDELfile_Click(Index As Integer)
'從mnuEXEfile數(shù)組中移走項(xiàng)目,送回mnuADDfile菜單數(shù)組
If intC >= filenumber Then
MsgBox "只有一個(gè)待執(zhí)行文件,不能再刪除!"
Exit Sub
End If
mnuDELfile(Index).Visible = False
mnuEXEfile(Index).Visible = False
mnuADDfile(Index).Visible = True
intC = intC + 1
End Sub
Private Sub mnuEXEfile_Click(Index As Integer)
'執(zhí)行項(xiàng)目
Select Case Index
Case 1
Debug.Print "執(zhí)行項(xiàng)目1"
Case 2
Debug.Print "執(zhí)行項(xiàng)目2"
Case 3
Debug.Print "執(zhí)行項(xiàng)目3"
Case 4
Debug.Print "執(zhí)行項(xiàng)目4"
Case 5
Debug.Print "執(zhí)行項(xiàng)目5"
End Select
End Sub
Private Sub mnuExit_Click()
Unload Me
End
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -