⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 一款漂亮的控件。 快
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1440
   ClientLeft      =   2280
   ClientTop       =   3060
   ClientWidth     =   3300
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   1440
   ScaleWidth      =   3300
   Begin VB.CommandButton CmdRemove 
      Cancel          =   -1  'True
      Caption         =   "删除"
      Height          =   495
      Left            =   1800
      TabIndex        =   3
      Top             =   720
      Width           =   1215
   End
   Begin VB.CommandButton CmdAdd 
      Caption         =   "增加"
      Default         =   -1  'True
      Height          =   495
      Left            =   240
      TabIndex        =   2
      Top             =   720
      Width           =   1215
   End
   Begin VB.TextBox CaptionText 
      Height          =   285
      Left            =   1080
      TabIndex        =   1
      Top             =   240
      Width           =   1935
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "菜单名称"
      Height          =   180
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   720
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuFileList 
         Caption         =   "新加菜单"
         Index           =   0
         Visible         =   0   'False
      End
      Begin VB.Menu mnuFileSep 
         Caption         =   "-"
         Visible         =   0   'False
      End
      Begin VB.Menu mnuFileExit 
         Caption         =   "退出(&E)"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private max_index As Integer
Private Sub CmdAdd_Click()
    ' Load the new menu item.
    max_index = max_index + 1
    Load mnuFileList(max_index)
    mnuFileList(max_index).Caption = CaptionText.Text
    mnuFileList(max_index).Visible = True
    CaptionText.Text = ""
    
    ' Make the separator visible.
    mnuFileSep.Visible = True
End Sub

Private Sub CmdRemove_Click()
Dim txt As String
Dim ctl As Menu

    ' Find the menu item with this caption.
    txt = CaptionText.Text
    CaptionText.Text = ""
    For Each ctl In mnuFileList
        If ctl.Caption = txt Then Unload ctl
    Next ctl
    
    ' Make the separator visible.
    If mnuFileList.Count < 2 Then _
        mnuFileSep.Visible = False
End Sub


Private Sub Form_Load()

End Sub

Private Sub mnuFileExit_Click()
    Unload Me
End Sub


Private Sub mnuFileList_Click(Index As Integer)
    MsgBox "Selected item" & Str$(Index)
End Sub


⌨️ 快捷键说明

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