📄 菜单的应用.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2820
ClientLeft = 165
ClientTop = 735
ClientWidth = 5190
LinkTopic = "Form1"
ScaleHeight = 2820
ScaleWidth = 5190
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 420
Left = 0
TabIndex = 1
Top = 0
Width = 5190
_ExtentX = 9155
_ExtentY = 741
ButtonWidth = 609
Appearance = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
ImageIndex = 3
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList ImageList1
Left = 2280
Top = 840
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 3
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "菜单的应用.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "菜单的应用.frx":08C4
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "菜单的应用.frx":1188
Key = ""
EndProperty
EndProperty
End
Begin VB.TextBox Text1
Height = 2295
Left = 0
TabIndex = 0
Top = 480
Width = 5175
End
Begin VB.Menu File
Caption = "文件(&F)"
Begin VB.Menu New
Caption = "新建(&N) Ctrl+N"
End
Begin VB.Menu Open
Caption = "打开(&O)... Ctrl+O"
End
Begin VB.Menu row1
Caption = "-"
End
Begin VB.Menu Close
Caption = "关闭(&C)"
End
End
Begin VB.Menu Edit
Caption = "编辑(&E)"
Begin VB.Menu Trim
Caption = "剪切(&T)"
End
Begin VB.Menu Copy
Caption = "复制(&C)"
End
Begin VB.Menu Paste
Caption = "粘贴(&P)"
End
Begin VB.Menu row2
Caption = "-"
End
Begin VB.Menu Allselect
Caption = "全选(&A)"
End
End
Begin VB.Menu Color
Caption = "颜色(&C)"
Begin VB.Menu Red
Caption = "红(&R)"
End
Begin VB.Menu Blue
Caption = "蓝(&B)"
End
Begin VB.Menu Green
Caption = "绿(&G)"
End
Begin VB.Menu row3
Caption = "-"
End
Begin VB.Menu SelfColor
Caption = "自定义颜色(&S)..."
End
End
Begin VB.Menu Tool
Caption = "工具(&T)"
Begin VB.Menu Ping
Caption = "拼写和语法(&Y)"
End
Begin VB.Menu Word
Caption = "字数统计(&W)..."
End
Begin VB.Menu row4
Caption = "-"
End
Begin VB.Menu Fform
Caption = "插入表格(&F)"
End
Begin VB.Menu Picture
Caption = "插入图片(&P)"
End
Begin VB.Menu row5
Caption = "-"
End
Begin VB.Menu Option
Caption = "选项(&O)..."
End
End
Begin VB.Menu Help
Caption = "帮助(&H)"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Blue_Click()
If Len(Text1.Text) <> 0 Then
Text1.ForeColor = vbBlue
End If
End Sub
Private Sub Green_Click()
If Len(Text1.Text) <> 0 Then
Text1.ForeColor = vbGreen
End If
End Sub
Private Sub Close_Click()
End
End Sub
Private Sub Form_Load()
Paste.Enabled = False
End Sub
Private Sub Paste_Click()
If Len(Clipboard.GetText) >= 0 Then
Paste.Enabled = True
Else
Paste.Enabled = False
End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu PictureEdit
End If
End Sub
Private Sub Ppaste_Click()
If Len(Clipboard.GetText) >= 0 Then
Ppaste.Enabled = True
Else
Ppaste.Enabled = False
End If
End Sub
End Sub
Private Sub Red_Click()
If Len(Text1.Text) <> 0 Then
Text1.ForeColor = vbRed
End If
End Sub
Private Sub SelfColor_Click()
CommonDialog1.ShowColor
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Key
Case 1
Text1.ForeColor = vbRed
Case 2
Text1.ForeColor = vbBlue
Case 3
Text1.ForeColor = vbGreen
End Select
End Sub
Private Sub Trim_Click()
If Trim.Checked = False Then
Trim.Checked = True
Else
Trim.Checked = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -