📄 printform.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form PrintForm1
Caption = "打印面板"
ClientHeight = 8595
ClientLeft = 60
ClientTop = 780
ClientWidth = 11880
LinkTopic = "Form13"
ScaleHeight = 8595
ScaleWidth = 11880
WindowState = 2 'Maximized
Begin VB.CheckBox Check1
Height = 375
Index = 0
Left = 120
Style = 1 'Graphical
TabIndex = 12
Top = 4920
Width = 1815
End
Begin MSComDlg.CommonDialog PDLG
Left = 0
Top = 8400
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
Height = 8415
Index = 0
Left = 2160
ScaleHeight = 8355
ScaleWidth = 9555
TabIndex = 10
Top = 120
Width = 9615
Begin VB.Image PicS
Height = 135
Left = 0
Top = 0
Width = 135
End
End
Begin VB.Frame Frame2
Height = 1335
Left = 120
TabIndex = 7
Top = 2880
Width = 1815
Begin VB.CommandButton Command2
Caption = "属性设置"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 120
TabIndex = 9
Top = 720
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "页面设置"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 0
Left = 120
TabIndex = 8
Top = 240
Width = 1575
End
End
Begin VB.CommandButton Command1
Caption = "开始打印"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 120
Picture = "PrintForm.frx":0000
Style = 1 'Graphical
TabIndex = 5
Top = 7560
Width = 1815
End
Begin VB.Frame Frame1
Height = 1815
Left = 120
TabIndex = 0
Top = 600
Width = 1815
Begin VB.OptionButton Option1
Caption = "打印机"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 2
Left = 120
Style = 1 'Graphical
TabIndex = 4
Top = 1200
Width = 1575
End
Begin VB.OptionButton Option1
Caption = "文件"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 120
Style = 1 'Graphical
TabIndex = 3
Top = 720
Width = 1575
End
Begin VB.OptionButton Option1
Caption = "屏幕"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 0
Left = 120
Style = 1 'Graphical
TabIndex = 2
Top = 240
Width = 1575
End
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00C0FFFF&
BorderStyle = 1 'Fixed Single
Caption = "打印项目"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 315
Index = 2
Left = 120
TabIndex = 11
Top = 4440
Width = 1815
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00C0FFFF&
BorderStyle = 1 'Fixed Single
Caption = "打印机设置"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 315
Index = 1
Left = 120
TabIndex = 6
Top = 2520
Width = 1815
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00C0FFFF&
BorderStyle = 1 'Fixed Single
Caption = "打印输出方向"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 315
Index = 0
Left = 120
TabIndex = 1
Top = 225
Width = 1815
End
End
Attribute VB_Name = "PrintForm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim oldx As Integer, oldy As Integer
Dim oldx2 As Integer, oldy2 As Integer
Dim check1v As Integer
Dim oldh As Integer, oldw As Integer, oldl As Integer, oldt As Integer
Dim OldCheck As Integer
Private Sub Check1_Click(Index As Integer)
If Check1.Count > 1 And OldCheck >= 0 Then
Check1(OldCheck) = 0
End If
OldCheck = Index
End Sub
Private Sub Command1_Click()
PD
End Sub
Private Sub Command2_Click(Index As Integer)
Select Case Index
Case 0
psdlg.lStructSize = Len(psdlg)
psdlg.hwndOwner = hwnd
PageSetupDlg psdlg
Case 1
PDLG.ShowPrinter
End Select
End Sub
Private Sub Form_Load()
OldCheck = -1
If UBound(PrintItem) > 1 Then
For ll = 1 To UBound(PrintItem) - 1
Load Check1(ll)
Check1(ll).Top = 4920 + 400 * ll
Check1(ll).Caption = PrintItem(ll)
Check1(ll).Visible = True
Next
Check1(0).Caption = PrintItem(0)
End If
' Picture1.Picture = LoadPicture("PASTEL.DIB")
' Picture2.AutoRedraw = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim ff As Form
Select Case PrintFromForm
Case "FormNew0"
Set ff = FormNew0
Case "FormNew6"
Set ff = FormNew6
Case "FormNew9"
Set ff = FormNew9
End Select
ff.Show
End Sub
Private Sub Pics_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
oldx = X
oldy = Y
End If
End Sub
Private Sub Pics_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
PicS.Left = PicS.Left - oldx + X
PicS.Top = PicS.Top - oldy + Y
End If
End Sub
Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
oldx2 = X
oldy2 = Y
End If
End Sub
Private Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
picture1(Index).Left = picture1(Index).Left - oldx2 + X
picture1(Index).Top = picture1(Index).Top - oldy2 + Y
End If
End Sub
Private Sub Picture1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
PD
End Sub
Sub PD()
If Option1(0).Value = True Then '屏幕打印
Select Case PrintFromForm
Case "FormNew4" ' 获奖
Case "FormNew0" ' 论文
Select Case OldCheck
Case 0
PicS.Visible = True
Set PicS = FormNew0.picture1
Case 1
PicS.Visible = False
picture1(0).Visible = True
PrinterFlag = False
PrintStartDoc picture1(0), PrinterFlag, 21, 29.7, 1
FormNew0.PrintGrid_New
Case 2
PicS.Visible = False
picture1(0).Visible = True
PrinterFlag = False
' PrintStartDoc picture1, PrinterFlag, 21, 29.7, 1
FormNew0.PrintGrid_New1 False
' FormNew0.PrintGrid_New1
End Select
Case "FormNew6" '科室
Select Case OldCheck
Case 0
PrinterFlag = False
PrintStartDoc picture1(0), PrinterFlag, 21, 29.7, 1
FormNew6.Print_1
Case 1
PrinterFlag = False
PrintStartDoc picture1(0), PrinterFlag, 21, 29.7, 1
FormNew6.Print_2
End Select
End Select
ElseIf Option1(1).Value = True Then '文件输出
Select Case PrintFromForm
Case "FormNew4"
FormNew4.PrintToFile
Case "FormNew0"
Select Case OldCheck
Case 0
End Select
End Select
ElseIf Option1(2).Value = True Then '打印机输出
Select Case PrintFromForm
Case "FormNew4"
FormNew4.printHJ
Case "FormNew0"
Select Case OldCheck
Case 0
Set pp1 = FormNew0.picture1
Printer.PaintPicture pp1, 5, 5
Printer.EndDoc
Case 1
PrinterFlag = True
PrintStartDoc picture1(0), PrinterFlag, 21, 29.7, 1
FormNew0.PrintGrid_New
Case 2
PrinterFlag = True
FormNew0.PrintGrid_New1 True
End Select
Case "FormNew6" '科室
Select Case OldCheck
Case 0
PrinterFlag = True
PrintStartDoc picture1(0), PrinterFlag, 21, 29.7, 1
FormNew6.Print_1
Case 1
PrinterFlag = True
PrintStartDoc picture1(0), PrinterFlag, 21, 29.7, 1
FormNew6.Print_2
End Select
End Select
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -