📄 form1.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form Form1
Caption = "打印大字体"
ClientHeight = 7395
ClientLeft = 60
ClientTop = 345
ClientWidth = 10875
LinkTopic = "Form1"
ScaleHeight = 7395
ScaleWidth = 10875
StartUpPosition = 1 '所有者中心
Begin RichTextLib.RichTextBox text1
Height = 7335
Left = 15
TabIndex = 15
Top = 45
Width = 8685
_ExtentX = 15319
_ExtentY = 12938
_Version = 393217
MultiLine = 0 'False
ScrollBars = 3
TextRTF = $"Form1.frx":0000
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 399.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.CommandButton Command5
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 720
Left = 8865
TabIndex = 13
Top = 6495
Width = 1845
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 8715
Top = 6135
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "大字体打印设置"
Height = 6150
Left = 8760
TabIndex = 0
Top = 105
Width = 2040
Begin VB.CommandButton Command6
Caption = "打印设置"
Height = 405
Left = 75
TabIndex = 14
Top = 330
Width = 1860
End
Begin VB.CheckBox Check2
Caption = "设置斜体"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 210
TabIndex = 12
Top = 5055
Width = 1770
End
Begin VB.CheckBox Check1
Caption = "设置粗体"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 210
TabIndex = 11
Top = 4695
Width = 1770
End
Begin VB.TextBox Text5
Height = 375
Left = 495
TabIndex = 8
Text = "70000"
Top = 4020
Width = 1440
End
Begin VB.CommandButton Command4
Caption = "打印"
Height = 405
Left = 75
TabIndex = 7
Top = 5550
Width = 1860
End
Begin VB.TextBox Text4
Height = 375
Left = 495
TabIndex = 6
Text = "50000"
Top = 3525
Width = 1440
End
Begin VB.CommandButton Command3
Caption = "自定义纸张大小"
Height = 405
Left = 75
TabIndex = 5
Top = 3000
Width = 1860
End
Begin VB.TextBox Text3
Height = 375
Left = 90
TabIndex = 4
Text = "400"
Top = 2475
Width = 1845
End
Begin VB.CommandButton Command2
Caption = "字体大小"
Height = 405
Left = 75
TabIndex = 3
Top = 1950
Width = 1860
End
Begin VB.TextBox Text2
Height = 375
Left = 90
TabIndex = 2
Text = "宋体"
Top = 1470
Width = 1845
End
Begin VB.CommandButton Command1
Caption = "字体设置"
Height = 405
Left = 75
TabIndex = 1
Top = 960
Width = 1860
End
Begin VB.Line Line1
X1 = 90
X2 = 1920
Y1 = 4575
Y2 = 4575
End
Begin VB.Label Label2
Caption = "高"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 165
TabIndex = 10
Top = 4065
Width = 405
End
Begin VB.Label Label1
Caption = "宽"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 135
TabIndex = 9
Top = 3600
Width = 405
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 Form_Load()
text1.Text = "中国"
text1.Font.Size = 400
text1.Font.Name = "宋体"
End Sub
Private Sub Text2_Change()
text1.Font.Name = IIf(Text2.Text <> "", Text2.Text, "宋体")
End Sub
Private Sub Text3_Change()
text1.Font.Size = IIf(Val(Text3.Text) > 0, Val(Text3.Text), 8)
End Sub
Private Sub Command1_Click()
On Error Resume Next
CommonDialog1.CancelError = True
' 设置 Flags 属性
CommonDialog1.Flags = cdlCFEffects Or cdlCFBoth
CommonDialog1.ShowFont
Text2.Text = IIf(CommonDialog1.FontName <> "", CommonDialog1.FontName, "宋体")
text1.Font.Name = CommonDialog1.FontName
Text3.Text = CommonDialog1.FontSize
text1.Font.Size = CommonDialog1.FontSize
End Sub
Private Sub Command4_Click()
Printer.Height = Text4.Text
Printer.Width = Text5.Text
Printer.FontBold = IIf(Check1.Value = 1, True, False)
Printer.FontItalic = IIf(Check2.Value = 1, True, False)
Printer.FontName = Text2.Text
Printer.FontSize = Text3.Text
Printer.CurrentX = 100
Printer.CurrentY = 100
Printer.Print text1.Text
Printer.EndDoc
End Sub
Private Sub Command6_Click()
CommonDialog1.ShowPrinter
End Sub
Private Sub Command5_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -