📄 formmain.frm
字号:
VERSION 5.00
Begin VB.Form formMain
BorderStyle = 1 'Fixed Single
Caption = "Font Project"
ClientHeight = 6450
ClientLeft = 45
ClientTop = 330
ClientWidth = 5985
FontTransparent = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6450
ScaleWidth = 5985
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox textSample
Height = 1815
Left = 120
TabIndex = 9
Top = 4500
Width = 5715
End
Begin VB.CommandButton cmndExit
Caption = "E&xit"
Height = 435
Left = 3900
TabIndex = 8
Top = 2460
Width = 1635
End
Begin VB.CommandButton cmndDisplay
Caption = "&Display Fonts"
Height = 435
Left = 3900
TabIndex = 7
Top = 1320
Width = 1635
End
Begin VB.Frame framEffects
Caption = "Special Effects"
Height = 3555
Left = 120
TabIndex = 2
Top = 720
Width = 3315
Begin VB.CheckBox chekUnderline
Caption = "&Underline"
Height = 255
Left = 480
TabIndex = 6
Top = 2760
Width = 1755
End
Begin VB.CheckBox chekStrikethru
Caption = "&StrikeThrough"
Height = 255
Left = 480
TabIndex = 5
Top = 2040
Width = 1755
End
Begin VB.CheckBox chekItalic
Caption = "&Italic"
Height = 255
Left = 480
TabIndex = 4
Top = 1260
Width = 1755
End
Begin VB.CheckBox chekBold
Caption = "&Bold"
Height = 255
Left = 480
TabIndex = 3
Top = 540
Width = 1755
End
End
Begin VB.ComboBox cmboSize
Height = 300
Left = 3240
TabIndex = 1
Text = "Combo2"
Top = 120
Width = 2595
End
Begin VB.ComboBox cmboFont
Height = 300
Left = 120
Sorted = -1 'True
TabIndex = 0
Text = "Combo1"
Top = 120
Width = 2775
End
End
Attribute VB_Name = "formMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub chekBold_Click()
textSample.Font.Bold = Not textSample.Font.Bold
End Sub
Private Sub chekItalic_Click()
textSample.Font.Italic = Not textSample.Font.Italic
End Sub
Private Sub chekStrikethru_Click()
textSample.Font.Strikethrough = Not textSample.Font.Strikethrough
End Sub
Private Sub chekUnderline_Click()
textSample.Font.Underline = Not textSample.Font.Underline
End Sub
Private Sub cmboFont_Click()
textSample.Font.Name = cmboFont.Text
textSample.Text = cmboFont.Text
End Sub
Private Sub cmboSize_Click()
textSample.Font.Size = Val(cmboSize.Text)
cmboSize.Text = Str(textSample.Font.Size)
End Sub
Private Sub cmndDisplay_Click()
formMain.Hide
Load formFontList
formFontList.Show
End Sub
Private Sub cmndExit_Click()
End
End Sub
Private Sub Form_Load()
For f = 0 To (Screen.FontCount - 1)
cmboFont.AddItem Screen.Fonts(f)
Next f
For p = 4 To 36
cmboSize.AddItem Str(p)
Next p
cmboFont.Text = textSample.Font.Name
cmboSize.Text = Str(textSample.Font.Size)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -