📄 print_frm.frm
字号:
Printer.FontSize = date_label.FontSize
Printer.FontBold = date_label.FontBold
Printer.FontItalic = date_label.FontItalic
Printer.FontUnderline = date_label.FontItalic
Printer.ForeColor = date_label.ForeColor
Printer.FontName = date_label.FontName
Printer.Print date_label.Caption
End If
If ymyw_time = "1" Then
Printer.CurrentX = time_label.Left
Printer.CurrentY = time_label.Top
Printer.FontSize = time_label.FontSize
Printer.FontBold = time_label.FontBold
Printer.FontItalic = time_label.FontItalic
Printer.FontUnderline = time_label.FontItalic
Printer.ForeColor = time_label.ForeColor
Printer.FontName = time_label.FontName
Printer.Print time_label.Caption
End If
If ymyw_ys = "1" Then
Printer.CurrentX = page_Label.Left
Printer.CurrentY = page_Label.Top
Printer.FontSize = page_Label.FontSize
Printer.FontBold = page_Label.FontBold
Printer.FontItalic = page_Label.FontItalic
Printer.FontUnderline = page_Label.FontItalic
Printer.ForeColor = page_Label.ForeColor
Printer.FontName = page_Label.FontName
Printer.Print page_Label.Caption
End If
If ymyw_ym_print = "1" Then
Printer.CurrentX = title_label.Left
Printer.CurrentY = title_label.Top
Printer.FontSize = title_label.FontSize
Printer.FontBold = title_label.FontBold
Printer.FontItalic = title_label.FontItalic
Printer.FontUnderline = title_label.FontItalic
Printer.ForeColor = title_label.ForeColor
Printer.FontName = title_label.FontName
Printer.Print title_label.Caption
End If
For i = 1 To bt_label.Count - 1
Printer.CurrentX = bt_label(i).Left
Printer.CurrentY = bt_label(i).Top
Printer.FontSize = bt_label(i).FontSize
Printer.FontBold = bt_label(i).FontBold
Printer.FontItalic = bt_label(i).FontItalic
Printer.FontUnderline = bt_label(i).FontItalic
Printer.ForeColor = bt_label(i).ForeColor
Printer.FontName = bt_label(i).FontName
Printer.Print bt_label(i).Caption
Next i
For i = 1 To zw_label.Count - 1
Printer.CurrentX = zw_label(i).Left
Printer.CurrentY = zw_label(i).Top
Printer.FontSize = zw_label(i).FontSize
Printer.FontBold = zw_label(i).FontBold
Printer.FontItalic = zw_label(i).FontItalic
Printer.FontUnderline = zw_label(i).FontItalic
Printer.ForeColor = zw_label(i).ForeColor
Printer.FontName = zw_label(i).FontName
Printer.Print zw_label(i).Caption
Next i
'连续打印
Printer.EndDoc
Exit Sub
myerr:
MsgBox "可能没有安装打印机或连接错误", vbOKOnly + vbCritical, "错误"
End Sub
Private Sub dysz_Click()
'cd.Flags = &H0
'cd.Flags = &O10
'cd.Flags = &H1
'cd.Flags = &H100000
'cd.Flags = &H40 '打印设置
cd.Copies = 1
cd.ShowPrinter
End Sub
Private Sub dyy_Click()
Picture1.Visible = False
dqys = 1
p = 0
For i = 1 To (bt_label.Count - 1) * Val(zw_dyhs)
zw_label(i) = ""
Next i
For i = p To p + (bt_label.Count - 1) * Val(zw_dyhs)
If i <= UBound(dynr) Then
zw_label(i) = dynr(i)
Else
Exit For
End If
Next i
dyy.Enabled = False
' Toolbar1.Buttons(4).Enabled = False
If dyys > 1 Then
xyy.Enabled = True
' Toolbar1.Buttons(5).Enabled = True
End If
y_Click Combo1.ListIndex
End Sub
Private Sub Form_Activate()
Static lindex As Boolean
If lindex = False Then
Combo1.ListIndex = 2
lindex = True
Else
'If Combo1.ListIndex >= 0 Then
' y_Click Combo1.ListIndex
' Else
' Combo1.ListIndex = 2
' End If
End If
If Combo1.Text = "" Then Combo1.ListIndex = 2
If dyys = 1 Then
xyy.Enabled = False
dyy.Enabled = False
' Toolbar1.Buttons(5).Enabled = False
' Toolbar1.Buttons(4).Enabled = False
End If
End Sub
Private Sub Form_Load()
Load ymsz_frm
'Picture1.Move 2, Toolbar1.Height + 2
VScroll1.Max = Picture1.Height '- Me.ScaleHeight + Toolbar1.Height + 8
HScroll1.Max = Picture1.Width '- Me.ScaleWidth + 5
VScroll1.Value = 0
HScroll1.Value = 0
dqys = 1
Picture1.BackColor = GetSetting("奇迹公司", "COLOR", "纸张颜色", RGB(255, 255, 255))
End Sub
Private Sub Form_Resize()
If Me.WindowState <> 1 Then
'VScroll1.Move Me.ScaleWidth - VScroll1.Width, Toolbar1.Height, 5, Me.ScaleHeight - Toolbar1.Height - 5
'HScroll1.Move 0, Me.ScaleHeight - HScroll1.Height, Me.ScaleWidth - 5, 5
End If
End Sub
Private Sub HScroll1_Change()
Picture1.Left = -HScroll1.Value + 3
End Sub
Private Sub HScroll1_Scroll()
Picture1.Left = -HScroll1.Value + 3
dqwz_hscroll = HScroll1.Value
End Sub
Private Sub lxdy_Click()
On Error GoTo myerr
Combo1.ListIndex = 2
Printer.ScaleMode = 6 '设为毫米模式
For p = 1 To dyys
If grid_print = "True" Then
For i = 0 To h_line.Count - 1
Printer.DrawWidth = h_line(i).BorderWidth
Printer.Line (h_line(i).X1, h_line(i).Y1)-(h_line(i).X2, h_line(i).Y2), Val(color_bg)
Next i
For i = 0 To s_Line.Count - 1
Printer.DrawWidth = s_Line(i).BorderWidth
Printer.Line (s_Line(i).X1, s_Line(i).Y1)-(s_Line(i).X2, s_Line(i).Y2), Val(color_bg)
Next i
End If
If ymyw_yw_print = "1" Then
Printer.CurrentX = tail_label.Left
Printer.CurrentY = tail_label.Top
Printer.FontSize = tail_label.FontSize
Printer.FontBold = tail_label.FontBold
Printer.FontItalic = tail_label.FontItalic
Printer.FontUnderline = tail_label.FontItalic
Printer.ForeColor = tail_label.ForeColor
Printer.FontName = tail_label.FontName
Printer.Print tail_label.Caption
End If
If ymyw_date = "1" Then
Printer.CurrentX = date_label.Left
Printer.CurrentY = date_label.Top
Printer.FontSize = date_label.FontSize
Printer.FontBold = date_label.FontBold
Printer.FontItalic = date_label.FontItalic
Printer.FontUnderline = date_label.FontItalic
Printer.ForeColor = date_label.ForeColor
Printer.FontName = date_label.FontName
Printer.Print date_label.Caption
End If
If ymyw_time = "1" Then
Printer.CurrentX = time_label.Left
Printer.CurrentY = time_label.Top
Printer.FontSize = time_label.FontSize
Printer.FontBold = time_label.FontBold
Printer.FontItalic = time_label.FontItalic
Printer.FontUnderline = time_label.FontItalic
Printer.ForeColor = time_label.ForeColor
Printer.FontName = time_label.FontName
Printer.Print time_label.Caption
End If
If ymyw_ys = "1" Then
Printer.CurrentX = page_Label.Left
Printer.CurrentY = page_Label.Top
Printer.FontSize = page_Label.FontSize
Printer.FontBold = page_Label.FontBold
Printer.FontItalic = page_Label.FontItalic
Printer.FontUnderline = page_Label.FontItalic
Printer.ForeColor = page_Label.ForeColor
Printer.FontName = page_Label.FontName
Printer.Print page_Label.Caption
End If
If ymyw_ym_print = "1" Then
Printer.CurrentX = title_label.Left
Printer.CurrentY = title_label.Top
Printer.FontSize = title_label.FontSize
Printer.FontBold = title_label.FontBold
Printer.FontItalic = title_label.FontItalic
Printer.FontUnderline = title_label.FontItalic
Printer.ForeColor = title_label.ForeColor
Printer.FontName = title_label.FontName
Printer.Print title_label.Caption
End If
For i = 1 To bt_label.Count - 1
Printer.CurrentX = bt_label(i).Left
Printer.CurrentY = bt_label(i).Top
Printer.FontSize = bt_label(i).FontSize
Printer.FontBold = bt_label(i).FontBold
Printer.FontItalic = bt_label(i).FontItalic
Printer.FontUnderline = bt_label(i).FontItalic
Printer.ForeColor = bt_label(i).ForeColor
Printer.FontName = bt_label(i).FontName
Printer.Print bt_label(i).Caption
Next i
For i = 1 To zw_label.Count - 1
Printer.CurrentX = zw_label(i).Left
Printer.CurrentY = zw_label(i).Top
Printer.FontSize = zw_label(i).FontSize
Printer.FontBold = zw_label(i).FontBold
Printer.FontItalic = zw_label(i).FontItalic
Printer.FontUnderline = zw_label(i).FontItalic
Printer.ForeColor = zw_label(i).ForeColor
Printer.FontName = zw_label(i).FontName
Printer.Print zw_label(i).Caption
Next i
'连续打印
If p <> dyys Then
xyy_Click
Printer.NewPage
End If
Next p
Printer.EndDoc
Exit Sub
myerr:
MsgBox "可能没有安装打印机或连接错误", vbOKOnly + vbCritical, "错误"
End Sub
Private Sub page_Label_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1_MouseUp Button, Shift, X, y
End Sub
Private Sub Picture1_Click() '放大
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
If Button = 1 Then
If Combo1.ListIndex = 0 Then
Else
Combo1.ListIndex = Combo1.ListIndex - 1
End If
Else
If Combo1.ListIndex = Combo1.ListCount - 1 Then
Else
Combo1.ListIndex = Combo1.ListIndex + 1
End If
End If
End Sub
Private Sub tc_Click()
Unload Me
End Sub
Private Sub time_label_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1_MouseUp Button, Shift, X, y
End Sub
Private Sub title_label_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1_MouseUp Button, Shift, X, y
End Sub
'Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
'Select Case Button.Key
'Case "tc"
' Unload Me
'Case "dyy"
' dyy_Click
'Case "xyy"
' xyy_Click
'Case "dy"
' dy_Click
'Case "ymsz"
' ymsz_frm.Show
'End Select
'End Sub
Private Sub VScroll1_Change()
Picture1.Top = -VScroll1.Value + 3 + Toolbar1.Height
End Sub
Private Sub VScroll1_Scroll()
Picture1.Top = -VScroll1.Value + 3 + Toolbar1.Height
dqwz_vscroll = VScroll1.Value
End Sub
Private Sub zt_Click()
cd.Flags = &H2
cd.ShowFont
End Sub
Private Sub xyy_Click()
Picture1.Visible = False
dqys = dqys + 1
p = (dqys - 1) * (bt_label.Count - 1) * Val(zw_dyhs) + 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -