📄 form1.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form Form1
Caption = "工具栏"
ClientHeight = 2970
ClientLeft = 60
ClientTop = 345
ClientWidth = 5745
LinkTopic = "Form1"
ScaleHeight = 2970
ScaleWidth = 5745
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.ImageList ImageList1
Left = 720
Top = 720
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 7
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":0112
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":0224
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":0766
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":0878
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":098A
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":0A9C
Key = ""
EndProperty
EndProperty
End
Begin VB.TextBox Text1
Height = 2415
Left = 720
MultiLine = -1 'True
TabIndex = 0
Text = "Form1.frx":0BAE
Top = 960
Width = 2535
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 420
Left = 0
TabIndex = 1
Top = 0
Width = 5745
_ExtentX = 10134
_ExtentY = 741
ButtonWidth = 1138
ButtonHeight = 582
Appearance = 1
TextAlignment = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 9
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Open"
Description = "通过对话框打开文本文件"
Object.ToolTipText = "打开文件"
Object.Tag = "Open"
ImageIndex = 1
MixedState = -1 'True
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Save"
Description = "保存文件"
Object.ToolTipText = "保存文件"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Preview"
Description = "打印预览"
Object.ToolTipText = "打印预览"
ImageIndex = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Print"
Description = "打印"
Object.ToolTipText = "打印"
ImageIndex = 4
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "FontBold"
Description = "黑体"
Object.ToolTipText = "黑体"
ImageIndex = 5
Style = 1
Object.Width = 1
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "FontItalic "
Description = "斜体"
Object.ToolTipText = "斜体"
ImageIndex = 6
Style = 1
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "FontULine"
Description = "下划 线"
Object.ToolTipText = "下划 线"
ImageIndex = 7
Style = 1
EndProperty
EndProperty
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Toolbar1_ButtonClick( _
ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 7
'如果单击的按钮的Index属性为7
If Button.Value = tbrPressed Then
Text1.FontBold = True
'如果此时按钮处于选中状态
'则将Text1的FontBold属性设置为True
Else
Text1.FontBold = False
'如果此时按钮处于非选中状态
'将Text1的FontBold属性设置为False
End If
Case 8
'如果单击的按钮的Index属性为8
If Button.Value = tbrPressed Then
Text1.FontItalic = True
'如果此时按钮处于选中状态
'将Text1的FontItalic属性设置为True
Else
Text1.FontItalic = False
End If
Case 9
If Button.Value = tbrPressed Then
Text1.FontUnderline = True
Else
Text1.FontUnderline = False
End If
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -