📄 form1.frm.bak
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 1980
ClientLeft = 60
ClientTop = 630
ClientWidth = 5925
LinkTopic = "Form1"
ScaleHeight = 1980
ScaleWidth = 5925
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdSplit2
Caption = "Command1"
Height = 495
Left = 4200
TabIndex = 1
Top = 1080
Width = 1215
End
Begin VB.CommandButton cmdSplit1
Caption = "Command1"
Height = 495
Left = 4200
TabIndex = 0
Top = 360
Width = 1215
End
Begin VB.Menu mnuOptions
Caption = "&Options"
Begin VB.Menu mnuItem1
Caption = "菜单1"
End
Begin VB.Menu mnuItem2
Caption = "菜单2"
End
Begin VB.Menu mnuItem3
Caption = "菜单3"
End
Begin VB.Menu mnuItem4
Caption = "菜单4"
End
Begin VB.Menu mnuItem5
Caption = "菜单5"
End
Begin VB.Menu mnuItem6
Caption = "菜单6"
End
Begin VB.Menu mnuItem7
Caption = "菜单7"
End
Begin VB.Menu mnuItem8
Caption = "菜单8"
End
Begin VB.Menu mnuItem9
Caption = "菜单9"
End
Begin VB.Menu mnuItem10
Caption = "菜单10"
End
Begin VB.Menu mnuItem11
Caption = "菜单11"
End
Begin VB.Menu mnuItem12
Caption = "菜单12"
End
Begin VB.Menu mnuItem13
Caption = "菜单13"
End
Begin VB.Menu mnuItem14
Caption = "菜单14"
End
Begin VB.Menu mnuItem15
Caption = "菜单15"
End
Begin VB.Menu mnuItem16
Caption = "菜单16"
End
Begin VB.Menu mnuItem17
Caption = "菜单17"
End
Begin VB.Menu mnuItem18
Caption = "菜单18"
End
Begin VB.Menu mnuItem19
Caption = "菜单19"
End
Begin VB.Menu mnuItem20
Caption = "退出"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdSplit1_Click()
'divides the menu at the last menu
'item (mnuItemCount - 1)
Dim r As Long
Dim hSubMenu As Long
Dim mnuItemCount As Long
Dim mInfo As MENUITEMINFO
'get the menuitem handle
hSubMenu = GetSubMenu(GetMenu(Me.hwnd), 0)
mnuItemCount = GetMenuItemCount(hSubMenu)
'retrieve the current information for the
'last item in the menu into an MENUITEMINFO structure.
'True means MF_BYPOSITION.
mInfo.cbSize = Len(mInfo)
mInfo.fMask = MIIM_TYPE
mInfo.fType = MFT_STRING
mInfo.dwTypeData = Space$(256)
mInfo.cch = Len(mInfo.dwTypeData)
r = GetMenuItemInfo(hSubMenu, mnuItemCount - 1, True, mInfo)
'modify its attributes to the new Type,
'telling the menu to insert a break before
'the member in the MENUITEMINFO structure.
mInfo.fType = RGB_STARTNEWCOLUMNWITHVERTBAR
'we only want to change the style, so reset fMask
mInfo.fMask = MIIM_TYPE
r = SetMenuItemInfo(hSubMenu, mnuItemCount - 1, True, mInfo)
If r Then Print " Done !"
End Sub
Private Sub cmdSplit2_Click()
'divides the menu into 2 even columns
Dim r As Long
Dim hSubMenu As Long
Dim mnuItemCount As Long
Dim mInfo As MENUITEMINFO
Dim pad As Long
'get the menuitem handle
hSubMenu = GetSubMenu(GetMenu(Me.hwnd), 0)
mnuItemCount = GetMenuItemCount(hSubMenu)
'if there are an odd number of menu items, make
'sure that the left column has the extra item
If mnuItemCount Mod 2 <> 0 Then pad = 1
'retrieve the current information for the
'last item in the menu into an MENUITEMINFO structure.
'True means MF_BYPOSITION.
mInfo.cbSize = Len(mInfo)
mInfo.fMask = MIIM_TYPE
mInfo.fType = MFT_STRING
mInfo.dwTypeData = Space$(256)
mInfo.cch = Len(mInfo.dwTypeData)
r = GetMenuItemInfo(hSubMenu, (mnuItemCount \ 2) + pad, True, mInfo)
'modify its attributes to the new Type,
'telling the menu to insert a break before
'the member in the MENUITEMINFO structure.
mInfo.fType = RGB_STARTNEWCOLUMNWITHVERTBAR
mInfo.fMask = MIIM_TYPE
r = SetMenuItemInfo(hSubMenu, (mnuItemCount \ 2) + pad, True, mInfo)
If r Then Print " Done !"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -