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

📄 menu.frm

📁 不错的一个VB菜单设计 界面和功能都不错
💻 FRM
字号:
VERSION 5.00
Object = "{E6BA1CE2-2668-11D4-93D6-400100005168}#2.0#0"; "FAST2011.ocx"
Begin VB.Form frmMenu 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "FWMenu & FWActiveMenu demo program"
   ClientHeight    =   5220
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7155
   Icon            =   "Menu.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5220
   ScaleWidth      =   7155
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.TextBox txtInfo 
      BackColor       =   &H8000000F&
      Height          =   315
      Left            =   1800
      Locked          =   -1  'True
      TabIndex        =   2
      Top             =   630
      Width           =   5235
   End
   Begin FLWCtrls2.FWActiveMenu objActiveMenu 
      Height          =   4545
      Left            =   90
      TabIndex        =   0
      Top             =   510
      Width           =   1500
      _ExtentX        =   2646
      _ExtentY        =   8176
      MenuCount       =   3
      MenuCaption1    =   "F&ile"
      ItemCount1      =   6
      ItemIcon11      =   "Menu.frx":000C
      ItemCaption11   =   "&New"
      ItemIcon12      =   "Menu.frx":011E
      ItemCaption12   =   "&Open"
      ItemIcon13      =   "Menu.frx":0230
      ItemCaption13   =   "&Print"
      ItemIcon14      =   "Menu.frx":0342
      ItemCaption14   =   "&Save"
      ItemIcon15      =   "Menu.frx":0454
      ItemCaption15   =   "Item 5"
      ItemIcon16      =   "Menu.frx":0566
      ItemCaption16   =   "Item 6"
      MenuCaption2    =   "E&dit"
      ItemCount2      =   3
      ItemIcon21      =   "Menu.frx":0678
      ItemCaption21   =   "Copy"
      ItemIcon22      =   "Menu.frx":078A
      ItemCaption22   =   "Cut"
      ItemIcon23      =   "Menu.frx":089C
      ItemCaption23   =   "Paste"
      MenuCaption3    =   "P&roject"
      ItemCount3      =   2
      ItemIcon31      =   "Menu.frx":09AE
      ItemCaption31   =   "Help"
      ItemIcon32      =   "Menu.frx":0AC0
      ItemCaption32   =   "More Help"
   End
   Begin FLWCtrls2.FWMenu objMenu 
      Align           =   1  'Align Top
      Height          =   345
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Width           =   7155
      _ExtentX        =   12621
      _ExtentY        =   609
      BackColor       =   -2147483633
      ItemsCount      =   160
      Item1Caption    =   "&File"
      Item1Key        =   "Key1"
      Item1Picture    =   "Menu.frx":0BD2
      Item2Caption    =   "&Open new document"
      Item2Key        =   "Key2"
      Item2KeyParent  =   "Key1"
      Item2Picture    =   "Menu.frx":0CE4
      Item3Caption    =   "&Save"
      Item3Key        =   "Key3"
      Item3KeyParent  =   "Key1"
      Item3Enabled    =   0   'False
      Item3Picture    =   "Menu.frx":0DF6
      Item4Caption    =   "-"
      Item4Key        =   "Key4"
      Item4KeyParent  =   "Key1"
      Item5Caption    =   "&Close"
      Item5Key        =   "Key5"
      Item5KeyParent  =   "Key1"
      Item6Caption    =   "&Print"
      Item6Key        =   "Key6"
      Item6KeyParent  =   "Key1"
      Item6Picture    =   "Menu.frx":0F08
      Item7Caption    =   "-"
      Item7Key        =   "Key7"
      Item7KeyParent  =   "Key1"
      Item8Caption    =   "&Exit"
      Item8Key        =   "Key8"
      Item8KeyParent  =   "Key1"
      Item9Caption    =   "&Edit"
      Item9Key        =   "Key9"
      Item10Caption   =   "&Cut"
      Item10Key       =   "Key10"
      Item10KeyParent =   "Key9"
      Item10Picture   =   "Menu.frx":101A
      Item11Caption   =   "&Copy"
      Item11Key       =   "Key11"
      Item11KeyParent =   "Key9"
      Item11Picture   =   "Menu.frx":112C
      Item12Caption   =   "Paste"
      Item12Key       =   "Key12"
      Item12KeyParent =   "Key9"
      Item12Picture   =   "Menu.frx":123E
      Item13Caption   =   "&Project"
      Item13Key       =   "Key13"
      Item13Picture   =   "Menu.frx":1350
      Item14Caption   =   "Debug"
      Item14Key       =   "Key14"
      Item14KeyParent =   "Key13"
      Item14Picture   =   "Menu.frx":1462
      Item15Caption   =   "Normal Debug"
      Item15Key       =   "Key15"
      Item15KeyParent =   "Key14"
      Item15Picture   =   "Menu.frx":1574
      Item16Caption   =   "Advanced debug"
      Item16Key       =   "Key16"
      Item16KeyParent =   "Key14"
      Item16Picture   =   "Menu.frx":1686
   End
   Begin FLWCtrls2.FWMenu FWMenu1 
      Height          =   435
      Left            =   2340
      TabIndex        =   4
      Top             =   2430
      Width           =   2835
      _ExtentX        =   5001
      _ExtentY        =   767
      BackColor       =   12632319
      ActiveBackColor =   255
      FontName        =   "Comic Sans MS"
      FontBold        =   -1  'True
      FontItalic      =   -1  'True
      FontSize        =   9
      ItemsCount      =   160
      Item1Key        =   "Key1"
      Item1Picture    =   "Menu.frx":1798
      Item2Caption    =   "&Open new document"
      Item2Key        =   "Key2"
      Item2KeyParent  =   "Key1"
      Item2Picture    =   "Menu.frx":18AA
      Item3Caption    =   "&Save"
      Item3Key        =   "Key3"
      Item3KeyParent  =   "Key1"
      Item3Enabled    =   0   'False
      Item3Picture    =   "Menu.frx":19BC
      Item4Caption    =   "-"
      Item4Key        =   "Key4"
      Item4KeyParent  =   "Key1"
      Item5Caption    =   "&Close"
      Item5Key        =   "Key5"
      Item5KeyParent  =   "Key1"
      Item6Caption    =   "&Print"
      Item6Key        =   "Key6"
      Item6KeyParent  =   "Key1"
      Item6Picture    =   "Menu.frx":1ACE
      Item7Caption    =   "-"
      Item7Key        =   "Key7"
      Item7KeyParent  =   "Key1"
      Item8Caption    =   "&Exit"
      Item8Key        =   "Key8"
      Item8KeyParent  =   "Key1"
      Item9Caption    =   "Ed&it"
      Item9Key        =   "Key9"
      Item10Caption   =   "&Cut"
      Item10Key       =   "Key10"
      Item10KeyParent =   "Key9"
      Item10Picture   =   "Menu.frx":1BE0
      Item11Caption   =   "&Copy"
      Item11Key       =   "Key11"
      Item11KeyParent =   "Key9"
      Item11Picture   =   "Menu.frx":1CF2
      Item12Caption   =   "Paste"
      Item12Key       =   "Key12"
      Item12KeyParent =   "Key9"
      Item12Picture   =   "Menu.frx":1E04
      Item13Key       =   "Key13"
      Item13Picture   =   "Menu.frx":1F16
      Item14Caption   =   "Debug"
      Item14Key       =   "Key14"
      Item14KeyParent =   "Key13"
      Item14Picture   =   "Menu.frx":2028
      Item15Caption   =   "Normal Debug"
      Item15Key       =   "Key15"
      Item15KeyParent =   "Key14"
      Item15Picture   =   "Menu.frx":213A
      Item16Caption   =   "Advanced debug"
      Item16Key       =   "Key16"
      Item16KeyParent =   "Key14"
      Item16Picture   =   "Menu.frx":224C
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Very fashion menu!!!"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   2370
      TabIndex        =   3
      Top             =   2190
      Width           =   1755
   End
End
Attribute VB_Name = "frmMenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
  ' Item keys can be numbers or strings; must be unique keys
  
  'Call objMenu.Add("&File", 1, , LoadPicture("\libs\fastwin\news\menu\camera.bmp"))
  'Call objMenu.Add("&Edit", 2)
  'Call objMenu.Add("&View", 3)
  'Call objMenu.Add("P&roject", 6)
  'Call objMenu.Add("", 4, , LoadPicture("\libs\fastwin\news\menu\copy.bmp"))
  'Call objMenu.Add("&Query", 5)
  'Call objMenu.Add("&Help", 7)

  'Call objMenu.Add("&Copy", 8, 1, LoadPicture("\libs\fastwin\news\menu\copy.bmp"))
  'Call objMenu.Add("C&ut", 9, 1, LoadPicture("\libs\fastwin\news\menu\cut.bmp"))
  'Call objMenu.Add("&Delete", 10, 1, LoadPicture("\libs\fastwin\news\menu\delete.bmp"))
  'Call objMenu.Add("-", 11, 1)
  'Call objMenu.Add("Ne&w", 12, 1, LoadPicture("\libs\fastwin\news\menu\new.bmp"))
  
  'Call objMenu.Add("&Open", 13, 9, LoadPicture("\libs\fastwin\news\menu\open.bmp"))
  'Call objMenu.Add("&Paste", 14, 9, LoadPicture("\libs\fastwin\news\menu\paste.bmp"))
  'Call objMenu.Add("Prin&t", 15, 9, LoadPicture("\libs\fastwin\news\menu\print.bmp"))

  'objMenu.ItemEnabled(2) = False
  'objMenu.ItemEnabled(14) = False

  'Call objMenu.Add("Property", 16, 4, LoadPicture("\libs\fastwin\news\menu\prop.bmp"))

  ' make Item "2" visible/invisible
  'objMenu.ItemVisible(2) = Not objMenu.ItemVisible(2)
End Sub

Private Sub FWMenu1_ItemClick(ByVal ItemKey As Variant)
  If ItemKey = "Key8" Then
    Unload Me
  End If
End Sub

Private Sub objActiveMenu_ItemClick(Menu As Long, Item As Long)
  txtInfo = "Clicked menu " & Menu & " && item " & Item
End Sub

Private Sub objActiveMenu_MenuClick(Menu As Long)
  txtInfo = "Clicked menu " & Menu
End Sub

Private Sub objActiveMenu_ScrollDown()
  txtInfo = "ScrollDown event"
End Sub

Private Sub objActiveMenu_ScrollUp()
  txtInfo = "ScrollUp event"
End Sub

Private Sub objMenu_FlyOver(ByVal ItemKey As Variant)
  txtInfo = "Fly over " & objMenu.ItemCaption(ItemKey)
End Sub

Private Sub objMenu_ItemClick(ByVal ItemKey As Variant)
  txtInfo = "Click " & objMenu.ItemCaption(ItemKey)
  
  If ItemKey = "Key8" Then
    Unload Me
  End If
End Sub

⌨️ 快捷键说明

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