📄 dyy.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{E228A480-FDCB-11D5-A3C8-0050BF074C3F}#36.0#0"; "curtPrinter.ocx"
Begin VB.Form dyyyl
AutoRedraw = -1 'True
BackColor = &H00E0E0E0&
ClientHeight = 6528
ClientLeft = -1080
ClientTop = -660
ClientWidth = 9504
Icon = "dyy.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6528
ScaleWidth = 9504
WindowState = 2 'Maximized
Begin MSComDlg.CommonDialog CommonDialog1
Left = 10080
Top = 120
_ExtentX = 677
_ExtentY = 677
_Version = 393216
End
Begin CurtPrinter打印预览控件.CurtPrinter CurtPrinter1
Height = 6612
Left = 0
TabIndex = 7
Top = 0
Visible = 0 'False
Width = 9132
_ExtentX = 16108
_ExtentY = 11663
ForeColor = -2147483640
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ToolBarColor = -2147483644
ToolBarStyle = 2
End
Begin VB.PictureBox picButtons
Align = 2 'Align Bottom
Appearance = 0 'Flat
BackColor = &H00404040&
BorderStyle = 0 'None
DrawStyle = 1 'Dash
DrawWidth = 32
ForeColor = &H80000008&
Height = 300
Left = 0
ScaleHeight = 300
ScaleWidth = 9504
TabIndex = 0
Top = 5892
Visible = 0 'False
Width = 9504
Begin VB.CommandButton Command2
Caption = "打印(&P)"
Height = 372
Left = 4440
TabIndex = 6
Top = 0
Visible = 0 'False
Width = 972
End
Begin VB.CommandButton Command1
Caption = "帮助"
Height = 372
Left = 5640
TabIndex = 5
Top = 0
Width = 1092
End
Begin VB.CommandButton cmdClose
Caption = "关闭(&C)"
Height = 300
Left = 7680
TabIndex = 4
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdRefresh
Caption = "刷新(&R)"
Height = 300
Left = 3060
TabIndex = 3
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdDelete
Caption = "删除(&D)"
Enabled = 0 'False
Height = 300
Left = 1675
TabIndex = 2
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdUpdate
Caption = "更新(&U)"
Enabled = 0 'False
Height = 300
Left = 290
TabIndex = 1
Top = 0
Width = 1095
End
End
Begin MSAdodcLib.Adodc datPrimaryRS
Align = 2 'Align Bottom
Height = 336
Left = 0
Top = 6192
Visible = 0 'False
Width = 9504
_ExtentX = 16764
_ExtentY = 593
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=dzqch"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "dzqch"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"dyy.frx":000C
Caption = " "
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Menu prin
Caption = "文件"
Begin VB.Menu mnuoutput
Caption = "导出"
End
Begin VB.Menu mnuPreview
Caption = "打印预览"
End
Begin VB.Menu mnuPrint
Caption = "打印"
End
Begin VB.Menu null
Caption = "-"
End
Begin VB.Menu mnuExit
Caption = "关闭"
End
End
Begin VB.Menu mnuManual
Caption = "编码控制预览"
Begin VB.Menu mnuPageUp
Caption = "上页"
End
Begin VB.Menu mnuPageDown
Caption = "下页"
End
Begin VB.Menu mnuZoom
Caption = "显示比例"
End
Begin VB.Menu mnuPaperSize
Caption = "选择纸张"
End
Begin VB.Menu mnuOrientation
Caption = "纸张方向"
End
End
Begin VB.Menu hlp
Caption = "帮助"
Begin VB.Menu about
Caption = "关于"
End
Begin VB.Menu neirong
Caption = "内容"
End
End
End
Attribute VB_Name = "dyyyl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim jl_sql As String
'##################################################################
'## 过程名称:Form_Load
'## 参数: 无
Private Sub mnuExit_Click()
Me.CurtPrinter1.Visible = False
End Sub
'##################################################################
'## 过程名称:mnuPreview_Click
'## 参数: 无
'##################################################################
Private Sub mnuPreview_Click()
CurtPrinter1.Visible = True
mnuManual.Enabled = True
PrintContent
End Sub
'##################################################################
'## 过程名称:mnuPrint_Click
'## 参数: 无
'##################################################################
Private Sub mnuPrint_Click()
PrintContent Printer
End Sub
'##################################################################
'## 过程名称:Text1_Change
'## 参数: 无
'##################################################################
'## 过程名称:curtprinter1_ClosePreview
'## 参数: 无
'##################################################################
Private Sub curtprinter1_ClosePreview()
CurtPrinter1.Visible = False
' mnuManual.Enabled = False
End Sub
'如果每次调整预览比例好重新生成预览的话,请将AutoRedraw设置为FALSE,然后在下面的事件添入要重画的代码
'##################################################################
'## 过程名称:curtprinter1_NeedRedraw
'## 参数: 无
'##################################################################
Private Sub CurtPrinter1_NeedRedraw()
PrintContent
End Sub
'写入打印叶脚的代码
'##################################################################
'## 过程名称:CurtPrinter1_PrintFooter
'## 参数:CurrentPage 为Long型
'## 参数:LeftText 为String型
'## 参数:CenterText 为String型
'## 参数:RightText 为String型
'##################################################################
Private Sub CurtPrinter1_PrintFooter(CurrentPage As Long, LeftText As String, CenterText As String, RightText As String)
''LeftText = jl_zgdw
CenterText = Format(Now, "yyyy年m月d日")
RightText = "其他信息"
End Sub
'写入打印页眉的代码
'##################################################################
'## 过程名称:CurtPrinter1_PrintHeader
'## 参数:CurrentPage 为Long型
'## 参数:LeftText 为String型
'## 参数:CenterText 为String型
'## 参数:RightText 为String型
'##################################################################
Private Sub CurtPrinter1_PrintHeader(CurrentPage As Long, LeftText As String, CenterText As String, RightText As String)
LeftText = Date
CenterText = jl_qym
RightText = "这是第 " & CurrentPage & " 页"
End Sub
'点击了预览窗体或直接调用ShowPrinter后,点击了打印机窗口的确定,引发打印代码,打印到打印机上!
'##################################################################
'## 过程名称:curtprinter1_RealPrint
'## 参数: 无
'##################################################################
Private Sub curtprinter1_RealPrint()
PrintContent Printer
End Sub
'如果隐藏工具条,仍可以通过简单的编程控制预览
'##################################################################
'## 过程名称:mnuPageDown_Click
'## 参数: 无
'##################################################################
Private Sub mnuPageDown_Click()
CurtPrinter1.PageDown
End Sub
'##################################################################
'## 过程名称:mnuPageSetup_Click
'## 参数: 无
'##################################################################
Private Sub mnuPageSetup_Click()
CurtPrinter1.PageSetup
End Sub
'##################################################################
'## 过程名称:mnuPageUp_Click
'## 参数: 无
'##################################################################
Private Sub mnuPageUp_Click()
CurtPrinter1.PageUp
End Sub
'##################################################################
'## 过程名称:mnuZoom_Click
'## 参数: 无
'##################################################################
Private Sub mnuZoom_Click()
CurtPrinter1.Zoom = Val(InputBox("请输入0-200之间的数字")) '0代表整页预览
End Sub
'##################################################################
'## 过程名称:mnuOrientation_Click
'## 参数: 无
'##################################################################
Private Sub mnuOrientation_Click()
CurtPrinter1.Orientation = IIf(CurtPrinter1.Orientation = 1, 2, 1)
End Sub
'##################################################################
'## 过程名称:mnuPaperSize_Click
'## 参数: 无
'##################################################################
Private Sub mnuPaperSize_Click()
CurtPrinter1.PaperSize = InputBox("请输入打印纸型号:")
End Sub
'复制字体属性
'##################################################################
'## 过程名称:CloneFont
'## 参数:Dest 为StdFont型
'## 参数:Src 为StdFont型
'##################################################################
Private Sub CloneFont(Dest As StdFont, Src As StdFont)
With Dest
.Bold = Src.Bold
.Charset = Src.Charset
.Italic = Src.Italic
.Name = Src.Name
.Size = Src.Size
.Strikethrough = Src.Strikethrough
.Underline = Src.Underline
.Weight = Src.Weight
End With
End Sub
'##################################################################
'## 过程名称:PrintContent
'## 参数:Optional 为ntDevice As Printer型
'##################################################################
Public Sub PrintContent(Optional PrintDevice As Printer)
Const TableStartX = 10
If PrintDevice Is Nothing Then
CurtPrinter1.StartPrint toPreview '预览
Else
CurtPrinter1.StartPrint toPrinter '打印到打印机
End If
Dim strr
With CurtPrinter1
'一些图形方法的演示
'重新开始一页,直接打印报表,注意,它会自动换页,如果你设定了标题,它也自动打哦:)
.NewPage
'直接打印MSHFlexGrid
.DirectPrint
.TextOut " "
.TextOut " "
.TextOut "说明:<毛重>对应统计的是(平均毛重),<皮重>对应统计的是(平均皮重),<净重>对应统计的是(累计净重)。"
.EndDoc
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -