📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4950
ClientLeft = 60
ClientTop = 345
ClientWidth = 5715
LinkTopic = "Form1"
ScaleHeight = 4950
ScaleWidth = 5715
StartUpPosition = 3 '窗口缺省
Begin VB.CheckBox Check3
Caption = "下划线"
Height = 255
Left = 4320
TabIndex = 6
Top = 4440
Width = 975
End
Begin VB.CheckBox Check2
Caption = "斜体"
Height = 255
Left = 4320
TabIndex = 5
Top = 4080
Width = 735
End
Begin VB.CheckBox Check1
Caption = "粗体"
Height = 255
Left = 4320
TabIndex = 4
Top = 3720
Width = 975
End
Begin VB.ListBox List1
Height = 2220
Left = 4200
TabIndex = 3
Top = 1320
Width = 1335
End
Begin VB.ComboBox Combo1
Height = 300
Left = 4200
TabIndex = 1
Text = "Combo1"
Top = 480
Width = 1335
End
Begin VB.TextBox Text1
Height = 4695
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Text = "Form1.frx":0000
Top = 120
Width = 3975
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "字体大小:"
Height = 180
Left = 4200
TabIndex = 7
Top = 960
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "字体:"
Height = 180
Left = 4200
TabIndex = 2
Top = 240
Width = 540
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
Text1.FontBold = True '粗体
End Sub
Private Sub Check2_Click()
Text1.FontItalic = True '斜体
End Sub
Private Sub Check3_Click()
Text1.FontUnderline = True '下划线
End Sub
Private Sub Combo1_Click()
'组合框的字体名称改变后,改变文本框的字体
Text1.FontName = Combo1.Text
End Sub
Private Sub Form_Load()
'实始化字体组合框,用Additem方法将Screnn对象中的所有字体加入组合框
Dim i As Integer
For i = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(i)
Next i
Combo1.Text = "宋体"
'初始化字体大小列表框
For i = 6 To 70 Step 2
List1.AddItem i
Next i
End Sub
Private Sub List1_Click()
'改变文本框的字体大小
Text1.FontSize = List1.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -