📄 form46.frm
字号:
VERSION 5.00
Begin VB.Form Form46
Caption = "结果显示打印窗口"
ClientHeight = 8985
ClientLeft = 60
ClientTop = 345
ClientWidth = 10830
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form46"
ScaleHeight = 8985
ScaleWidth = 10830
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "打印"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 5760
TabIndex = 2
Top = 8160
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 7560
TabIndex = 1
Top = 8160
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "显示结果"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 9120
TabIndex = 0
Top = 8160
Width = 1455
End
End
Attribute VB_Name = "Form46"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'打印机触发
Private Sub Command1_Click()
Me.AutoRedraw = True
Command1.Visible = False
Command2.Visible = False
Command3.Visible = False
Dim UR As Integer
UR = MsgBox("做好打印准备后请按“OK”,取消打印请按“Cancel”", vbOKCancel + vbInformation + vbDefaultButton1, "打印准备")
If (UR = vbCancel) Then
Me.Hide
Form2.Show
Else: On Error GoTo printerror
Me.PrintForm
End If
Exit Sub
printerror:
MsgBox (Err.Description), , "出错信息"
Me.Hide
Form2.Show
End Sub
Private Sub Command2_Click()
Me.Hide
Form2.Show
Unload Me
End Sub
Private Sub Command3_Click()
Dim m As Single
Dim av As Double
Dim ha As Single
Dim hf As Single
Dim h As Single
Dim da As Single
Dim df As Single
Dim db As Single
Dim p As Single
Dim pb As Single
Dim s As Single
Dim e As Single
Dim a As Single
Dim d0 As Single
Dim d As Single
Dim i As Single
Dim z1 As Single
Dim z2 As Single
Dim c As Single
m = Form2.Text1.Text
z1 = Form2.Text4.Text
z2 = Form2.Text2.Text
av = Form2.Text3.Text
d = Form2.Text5.Text
ha = Form2.Text6.Text
hf = Form2.Text7.Text
h = Form2.Text8.Text
da = Form2.Text9.Text
df = Form2.Text10.Text
db = Form2.Text11.Text
p = Form2.Text12.Text
pb = Form2.Text13.Text
s = Form2.Text14.Text
e = Form2.Text15.Text
c = Form2.Text16.Text
a = Form2.Text17.Text
d0 = Form2.Text18.Text
i = Form2.Text19.Text
Command1.Enabled = True
Command2.Enabled = True
Command1.Visible = True
Command2.Visible = True
Me.Print
Me.Print Spc(5); "直齿大齿轮几何参数计算结果如下:(压力角单位为 °,各尺寸单位为mm)"
Me.Print
Me.Print
Me.Print Spc(5); "已知参数:"
Me.Print
Me.Print Spc(5); "模 数:"; Spc(5); m
Me.Print
Me.Print Spc(5); "小齿轮齿数:"; Spc(5); z1
Me.Print
Me.Print Spc(5); "大齿轮齿数:"; Spc(5); z2
Me.Print
Me.Print Spc(5); "压 力 角:"; Spc(5); av
Me.Print
Me.Print Spc(5); "计算所得结果为:"
Me.Print
Me.Print Spc(5); "分度圆直径:"; Spc(5); d
Me.Print
Me.Print Spc(5); "齿 顶 高:"; Spc(5); ha
Me.Print
Me.Print Spc(5); "齿 根 高:"; Spc(5); hf
Me.Print
Me.Print Spc(5); "齿 全 高:"; Spc(5); h
Me.Print
Me.Print Spc(5); "齿定圆直径:"; Spc(5); da
Me.Print
Me.Print Spc(5); "齿根圆直径:"; Spc(5); df
Me.Print
Me.Print Spc(5); "基 圆 直径:"; Spc(5); db
Me.Print
Me.Print Spc(5); "齿 距:"; Spc(5); p
Me.Print
Me.Print Spc(5); "基 圆 齿距:"; Spc(5); pb
Me.Print
Me.Print Spc(5); "齿 厚:"; Spc(5); s
Me.Print
Me.Print Spc(5); "齿 槽 宽:"; Spc(5); e
Me.Print
Me.Print Spc(5); "顶 隙:"; Spc(5); c
Me.Print
Me.Print Spc(5); "标准中心距:"; Spc(5); a
Me.Print
Me.Print Spc(5); "节 圆 直径:"; Spc(5); d0
Me.Print
Me.Print Spc(5); "传 动 比:"; Spc(5); i
End Sub
Private Sub Form_Load()
'Me.WindowState = 2 '最大化
Me.BackColor = &HFFFFFF
Me.ForeColor = &H80000012
FontSize = 10
Form2.Hide
Command1.Enabled = False
Command2.Enabled = False
Command1.Visible = False
Command2.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -