📄 print_frm.frm
字号:
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) - 1
If i <= UBound(dynr) Then
zw_label(IIf(i Mod (bt_label.Count - 1) * Val(zw_dyhs) = 0, (bt_label.Count - 1) * Val(zw_dyhs), (i Mod (bt_label.Count - 1) * Val(zw_dyhs)))) = dynr(i)
Else
Exit For
End If
Next i
If dqys = dyys Then
xyy.Enabled = False
Toolbar1.Buttons(5).Enabled = False
End If
If dyys > 1 Then
dyy.Enabled = True
Toolbar1.Buttons(4).Enabled = True
End If
y_Click Combo1.ListIndex
End Sub
Public Sub y_Click(Index As Integer)
For i = 0 To 5
y(i).Checked = False
Next i
y(Index).Checked = True
Combo1.ListIndex = Index
Picture1.Visible = False
fdsx
z_fdsx
pl
Picture1.Visible = True
End Sub
Private Sub ymsz_Click()
ymsz_frm.Show
End Sub
Private Sub z_fdsx()
Select Case Combo1.ListIndex
Case 0
fdbs = 2
Case 1
fdbs = 1.5
Case 2
fdbs = 1
Case 3
fdbs = 0.75
Case 4
fdbs = 0.5
Case 5
fdbs = 0.25
End Select
'按比例宿放字大小
title_label.FontSize = fdbs * Val(ym_fontsize)
tail_label.FontSize = fdbs * Val(yw_fontsize)
For i = 0 To bt_label.Count - 1
bt_label(i).FontSize = fdbs * Val(zw_fontsize)
Next i
For i = 0 To zw_label.Count - 1
zw_label(i).FontSize = fdbs * Val(zw_fontsize)
Next i
date_label.FontSize = 9 * fdbs
time_label.FontSize = 9 * fdbs
page_Label.FontSize = 9 * fdbs
End Sub
Private Sub fdsx()
If grid_print = "False" Then
For i = 0 To h_line.Count - 1
h_line(i).Visible = False
Next i
For i = 0 To s_Line.Count - 1
s_Line(i).Visible = False
Next i
Else
For i = 0 To h_line.Count - 1
h_line(i).Visible = True
Next i
For i = 0 To s_Line.Count - 1
s_Line(i).Visible = True
Next i
End If
Select Case Combo1.ListIndex
Case 0
fdbs = 2
Case 1
fdbs = 1.5
Case 2
fdbs = 1
Case 3
fdbs = 0.75
Case 4
fdbs = 0.5
Case 5
fdbs = 0.25
End Select
Select Case paper_size
Case "0"
zk = 210
zc = 297
Case "1"
zk = 184
zc = 260
Case "2"
zk = 140
zc = 203
Case "3"
zk = 362
zc = 255
Case "4"
zk = paper_width
zc = paper_height
End Select
Picture1.Height = zc * fdbs
Picture1.Width = zk * fdbs
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
End Sub
Private Sub pl()
Select Case Combo1.ListIndex
Case 0
fdbs = 2
Case 1
fdbs = 1.5
Case 2
fdbs = 1
Case 3
fdbs = 0.75
Case 4
fdbs = 0.5
Case 5
fdbs = 0.25
End Select
zws = zw_label.Count - 1
bts = bt_label.Count - 1
h_line(0).Y1 = Val(grid_dbj) * fdbs
h_line(0).Y2 = Val(grid_dbj) * fdbs
s_Line(0).X1 = Val(grid_zbj) * fdbs
s_Line(0).X2 = Val(grid_zbj) * fdbs
h_line(0).X1 = s_Line(0).X1
h_line(0).X2 = h_line(0).X1
s_Line(0).Y1 = h_line(0).Y1
s_Line(0).Y2 = s_Line(0).Y1
If grid_czjz = "1" Then
h_line(0).Y1 = (Picture1.Height - (h_line.Count - 1) * Val(grid_hx) * fdbs) / 2
h_line(0).Y2 = h_line(0).Y1
End If
If grid_spjz = "1" Then
s_Line(0).X1 = (Picture1.Width - (s_Line.Count - 1) * Val(grid_sx) * fdbs) / 2
s_Line(0).X2 = s_Line(0).X1
End If
If grid_spjz = "1" Then
h_line(0).X1 = s_Line(0).X1
h_line(0).X2 = h_line(0).X1
End If
If grid_czjz = "1" Then
s_Line(0).Y1 = h_line(0).Y1
s_Line(0).Y2 = s_Line(0).Y1
End If
For i = 0 To h_line.Count - 1
h_line(i).Y1 = h_line(0).Y1 + i * Val(grid_hx) * fdbs
h_line(i).Y2 = h_line(i).Y1
Next i
For i = 0 To s_Line.Count - 1
s_Line(i).X1 = s_Line(0).X1 + i * Val(grid_sx) * fdbs
s_Line(i).X2 = s_Line(i).X1
Next i
For i = 0 To h_line.Count - 1
h_line(i).X1 = h_line(0).X1
h_line(i).X2 = s_Line(s_Line.Count - 1).X1
Next i
For i = 0 To s_Line.Count - 1
s_Line(i).Y1 = s_Line(0).Y1
s_Line(i).Y2 = h_line(h_line.Count - 1).Y1
Next i
For i = 1 To bts
bt_label(i).Left = ((s_Line(i).X1 - s_Line(i - 1).X1) - bt_label(i).Width) / 2 + s_Line(i - 1).X1
'bt_label(i).Top = ((h_line(0).Y1 - h_line(1).Y1) - bt_label(0).Height) / 2 + h_line(1).Y1
bt_label(i).Top = ((h_line(1).Y1 - h_line(0).Y1) - bt_label(0).Height) / 2 + h_line(0).Y1
Next i
If bts <> 0 Then hs = zws \ bts
If bts <> 0 Then
For i = 1 To (hs)
For j = (i * bts - (bts - 1)) To bts * i
'zw_label(j).Left = bt_label(j - (i - 1) * bts).Left
zw_label(j).Left = ((s_Line(j - (i - 1) * bts).X1 - s_Line(j - (i - 1) * bts - 1).X1) - zw_label(j).Width) / 2 + s_Line(j - (i - 1) * bts - 1).X1
zw_label(j).Top = ((h_line(i + 1).Y1 - h_line(i).Y1) - zw_label(j).Height) / 2 + h_line(i).Y1
Next j
Next i
End If
'表头字体加粗
For i = 0 To bts
If bt_fontbold = "1" Then
bt_label(i).FontBold = True
Else
bt_label(i).FontBold = False
End If
bt_label(i).FontName = zw_fontname
' bt_label(i).FontSize = Val(zw_fontsize) * fdbs
bt_label(i).ForeColor = Val(color_zw)
Next i
'页眉
title_label = ym_nr
title_label.FontName = ym_fontname
'title_label.FontSize = Val(ym_fontsize) * fdbs
If ym_fontbold = "1" Then
title_label.FontBold = True
Else
title_label.FontBold = False
End If
If ym_fontitalic = "1" Then
title_label.FontItalic = True
Else
title_label.FontItalic = False
End If
If ym_fontunderline = "1" Then
title_label.FontUnderline = True
Else
title_label.FontUnderline = False
End If
title_label.ForeColor = Val(color_ym)
If ymyw_ym_print = "0" Then
title_label.Visible = False
Else
title_label.Visible = True
End If
If ymyw_ym_center = "1" Then
title_label.Left = (Picture1.Width - title_label.Width) / 2
Else
title_label.Left = Val(ymyw_ym_zbj) * fdbs
End If
title_label.Top = Val(ymyw_ym_dbj) * fdbs
'页尾
tail_label = yw_nr
tail_label.FontName = yw_fontname
'tail_label.FontSize = Val(yw_fontsize)*fdbs
If yw_fontbold = "1" Then
tail_label.FontBold = True
Else
tail_label.FontBold = False
End If
If yw_fontitalic = "1" Then
tail_label.FontItalic = True
Else
tail_label.FontItalic = False
End If
If yw_fontunderline = "1" Then
tail_label.FontUnderline = True
Else
tail_label.FontUnderline = False
End If
tail_label.ForeColor = Val(color_yw)
If ymyw_yw_print = "0" Then
tail_label.Visible = False
Else
tail_label.Visible = True
End If
If ymyw_yw_center = "1" Then
tail_label.Left = (Picture1.Width - tail_label.Width) / 2
Else
tail_label.Left = Val(ymyw_yw_zbj) * fdbs
End If
tail_label.Top = Val(ymyw_yw_dbj) * fdbs
'正文
For i = 0 To zws
zw_label(i).FontName = zw_fontname
'zw_label(i).FontSize = Val(zw_fontsize) * fdbs
If zw_fontbold = "1" Then
zw_label(i).FontBold = True
Else
zw_label(i).FontBold = False
End If
If zw_fontitalic = "1" Then
zw_label(i).FontItalic = True
Else
zw_label(i).FontItalic = False
End If
If zw_fontunderline = "1" Then
zw_label(i).FontUnderline = True
Else
zw_label(i).FontUnderline = False
End If
zw_label(i).ForeColor = color_zw
Next i
'表格颜色,宽度
For i = 0 To h_line.Count - 1
h_line(i).BorderWidth = Val(grid_width)
h_line(i).BorderColor = Val(color_bg)
Next i
For i = 0 To s_Line.Count - 1
s_Line(i).BorderWidth = Val(grid_width)
s_Line(i).BorderColor = Val(color_bg)
Next i
If ymyw_ys = "1" Then
page_Label.Visible = True
If ymyw_ys_ys = "False" Then
page_Label = "第 " & dqys & "/" & dyys & " 页"
Else
page_Label = "第 " & dqys & " 页"
End If
page_Label.Left = (Picture1.Width - page_Label.Width) / 2
page_Label.Top = Picture1.Height - Val(ymys_ys_dbj) * fdbs
Else
page_Label.Visible = False
End If
'日期打印
If ymyw_date = "1" Then
date_label.Visible = True
date_label = "打印日期:" & Format(Date, "yyyy-mm-dd")
date_label.Move s_Line(0).X1, h_line(h_line.Count - 1).Y1 + Val(grid_hx) * fdbs / 2
Else
date_label.Visible = False
End If
'时间打印
If ymyw_time = "1" Then
time_label.Visible = True
time_label = "打印时间:" & Time
time_label.Move s_Line(s_Line.Count - 1).X1 - time_label.Width, h_line(h_line.Count - 1).Y1 + Val(grid_hx) * fdbs / 2
Else
time_label.Visible = False
End If
End Sub
Private Sub ztbz_Click()
If Dir(AppPath + "print.hlp") = "" Then
MsgBox "当前路径下没有帮助文件", vbOKOnly + vbCritical, "错误"
Exit Sub
End If
cd.HelpFile = AppPath + "print.hlp"
cd.HelpCommand = cdlHelpContents
cd.ShowHelp
End Sub
Private Sub zw_label_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1_MouseUp Button, Shift, X, y
End Sub
Private Sub zzys_Click()
cd.Color = Picture1.BackColor
cd.ShowColor
Picture1.BackColor = cd.Color
SaveSetting "奇迹公司", "COLOR", "纸张颜色", cd.Color
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -