?? frmprint.frm
字號:
VERSION 5.00
Object = "{98958EE2-9C75-11D1-9CFE-0060083A7314}#1.0#0"; "PRNTPRO1.OCX"
Begin VB.Form frmPrint
BorderStyle = 3 'Fixed Dialog
Caption = "打印通知單"
ClientHeight = 2052
ClientLeft = 48
ClientTop = 336
ClientWidth = 2808
Icon = "frmPrint.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2052
ScaleWidth = 2808
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Visible = 0 'False
Begin PRNTPRO1LibCtl.PrintPRO PrintPRO1
Left = 228
Top = 144
ErrStr = "INAIDJGEPDBNOLGMDKAIMGGLFOOCENINFAAONDHKDCJNDC"
ErrCode = 1717179196
ErrInfo = 666381833
AddCR = -1 'True
Alignment = 0
BackColor = 16777215
BackStyle = 0
BMargin = 331.2
CurrentX = 379.2
CurrentY = 331.2
DocName = "PrintPRO Document"
DrawMode = 13
DrawStyle = 1
DrawWidth = 1
FillColor = 0
FillStyle = 1
ForeColor = 0
LMargin = 379.2
ScaleMode = 1
TMargin = 331.2
WordWrap = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 7.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "frmPrint.frx":0442
AutoMargin = -1 'True
OutputFileName = ""
End
End
Attribute VB_Name = "frmPrint"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Function PrintNotes(ByVal sNo As String, _
ByVal sCarMan As String, ByVal sMotorMan As String, _
ByVal sCarNumber As String, ByVal sPostName As String, _
ByVal sCaptureDateTime As String, _
ByVal sReson As String, _
ByVal sPrintDate As String, _
ByVal sPicFile As String, _
ByVal sCarStyle As String _
) As Boolean
Dim prWidth As Single, i As Integer, lError
Const CM = 566
PrintPRO1.PrintDialog
lError = PrintPRO1.PrintError
If lError = 0 Then
Screen.MousePointer = 11
PrintPRO1.DocName = "打印違章通知單"
PrintPRO1.SelectDefaultPrinter
For i = 1 To PrintPRO1.Copies
PrintPRO1.StartPrintDoc
PrintPRO1.BackStyle = 0 'Transparent background
PrintPRO1.ForeColor = RGB(0, 0, 0) 'Black background
PrintPRO1.BackColor = RGB(255, 255, 255) 'White text
'違章通知書
PrintPRO1.Font.Name = "黑體"
PrintPRO1.Font.Bold = False
PrintPRO1.Font.Size = 24
PrintPRO1.Alignment = ALIGN_CenterJustifyMiddle ' Center justify the text
prWidth = PrintPRO1.PWidth
PrintPRO1.PrintTextAligned "違 章 通 知 書", 0, 2 * CM, prWidth, 3 * CM
'打印編號
PrintPRO1.Font.Name = "宋體"
PrintPRO1.Font.Bold = False
PrintPRO1.Font.Size = 18
PrintPRO1.Alignment = ALIGN_RightJustifyMiddle ' Center justify the text
prWidth = PrintPRO1.PWidth
PrintPRO1.PrintTextAligned sNo, 0, 3 * CM, prWidth - 3 * CM, 4 * CM
'上端信息
Dim starLine As Single
Dim startCharLeft As Single, startCharTop As Single
PrintPRO1.Font.Name = "宋體"
PrintPRO1.Font.Bold = False
PrintPRO1.Font.Size = 12
PrintPRO1.Alignment = ALIGN_LeftJustifyMiddle ' Center justify the text
starLine = 4.5 * CM
startCharLeft = 2.5 * CM
startCharTop = 4.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop
PrintPRO1.PrintText "車 主:" & sCarMan
PrintPRO1.DrawLine starLine, startCharTop + 0.5 * CM, starLine + 5.7 * CM, startCharTop + 0.5 * CM
PrintPRO1.CurrentX = startCharLeft + 8 * CM
PrintPRO1.CurrentY = startCharTop
PrintPRO1.PrintText "姓 名:" & sMotorMan
PrintPRO1.DrawLine starLine + 8 * CM, startCharTop + 0.5 * CM, starLine + 14 * CM, startCharTop + 0.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + CM
PrintPRO1.PrintText "車牌號碼:" & sCarNumber
PrintPRO1.DrawLine starLine, startCharTop + 1.5 * CM, starLine + 5.7 * CM, startCharTop + 1.5 * CM
PrintPRO1.CurrentX = startCharLeft + 8 * CM
PrintPRO1.CurrentY = startCharTop + CM
PrintPRO1.PrintText "違章地點:" & sPostName
PrintPRO1.DrawLine starLine + 8 * CM, startCharTop + 1.5 * CM, starLine + 14 * CM, startCharTop + 1.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + 2 * CM
PrintPRO1.PrintText "違章時間:" & sCaptureDateTime
PrintPRO1.DrawLine starLine, startCharTop + 2.5 * CM, starLine + 14 * CM, startCharTop + 2.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + 3 * CM
PrintPRO1.PrintText "違章原因:" & sReson
PrintPRO1.DrawLine starLine, startCharTop + 3.5 * CM, starLine + 14 * CM, startCharTop + 3.5 * CM
PrintPRO1.CurrentX = startCharLeft + 0.75 * CM
PrintPRO1.CurrentY = startCharTop + 4 * CM
PrintPRO1.PrintText "請在收到此通知5日內(nèi)到交通秩序大隊接受處罰。"
PrintPRO1.CurrentX = startCharLeft + 0.75 * CM
PrintPRO1.CurrentY = startCharTop + 4.8 * CM
PrintPRO1.PrintText "附違章現(xiàn)場照片:"
'圖片
PrintPRO1.Picture = LoadPicture(sPicFile)
PrintPRO1.PrintPicture startCharLeft + 1.5 * CM, 10.8 * CM
Dim Top2 As Single
Top2 = 11.2 * CM + 288 * Screen.TwipsPerPixelY
PrintPRO1.Font.Name = "宋體"
PrintPRO1.Font.Bold = False
PrintPRO1.Font.Size = 16
PrintPRO1.Alignment = ALIGN_RightJustifyMiddle ' Center justify the text
prWidth = PrintPRO1.PWidth
PrintPRO1.PrintTextAligned "秦皇島市公安交警支隊", 0, Top2, prWidth - 2 * CM, Top2 + CM
PrintPRO1.Font.Name = "宋體"
PrintPRO1.Font.Bold = False
PrintPRO1.Font.Size = 12
PrintPRO1.Alignment = ALIGN_RightJustifyTop ' Center justify the text
prWidth = PrintPRO1.PWidth
PrintPRO1.PrintTextAligned sPrintDate, 0, Top2 + CM, prWidth - 2 * CM, Top2 + CM + CM
PrintPRO1.DrawStyle = STYLE_Dot
PrintPRO1.DrawLine startCharLeft, Top2 + 2.2 * CM, prWidth - 2 * CM, Top2 + 2.2 * CM
' 存根
Dim Top3 As Single
Top3 = Top2 + 3.6 * CM
starLine = starLine + CM
startCharLeft = startCharLeft + CM
startCharTop = Top3
PrintPRO1.DrawStyle = STYLE_Solid
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop
PrintPRO1.PrintText "車 主:" & sCarMan
PrintPRO1.DrawLine starLine, startCharTop + 0.5 * CM, starLine + 5.7 * CM, startCharTop + 0.5 * CM
PrintPRO1.CurrentX = startCharLeft + 8 * CM
PrintPRO1.CurrentY = startCharTop
PrintPRO1.PrintText "姓名:" & sMotorMan
PrintPRO1.DrawLine starLine + 7 * CM, startCharTop + 0.5 * CM, starLine + 12 * CM, startCharTop + 0.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + CM
PrintPRO1.PrintText "車牌號碼:" & sCarNumber
PrintPRO1.DrawLine starLine, startCharTop + 1.5 * CM, starLine + 5.7 * CM, startCharTop + 1.5 * CM
PrintPRO1.CurrentX = startCharLeft + 8 * CM
PrintPRO1.CurrentY = startCharTop + CM
PrintPRO1.PrintText "車型:" & sCarStyle
PrintPRO1.DrawLine starLine + 7 * CM, startCharTop + 1.5 * CM, starLine + 12 * CM, startCharTop + 1.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + 2 * CM
PrintPRO1.PrintText "違章地點:" & sPostName
PrintPRO1.DrawLine starLine, startCharTop + 2.5 * CM, starLine + 12 * CM, startCharTop + 2.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + 3 * CM
PrintPRO1.PrintText "違章時間:" & sCaptureDateTime
PrintPRO1.DrawLine starLine, startCharTop + 3.5 * CM, starLine + 12 * CM, startCharTop + 3.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + 4 * CM
PrintPRO1.PrintText "處理結(jié)果:"
PrintPRO1.DrawLine starLine, startCharTop + 4.5 * CM, starLine + 12 * CM, startCharTop + 4.5 * CM
PrintPRO1.CurrentX = startCharLeft
PrintPRO1.CurrentY = startCharTop + 5 * CM
PrintPRO1.PrintText "違章人簽字:"
PrintPRO1.DrawLine starLine + 0.5 * CM, startCharTop + 5.5 * CM, starLine + 6 * CM, startCharTop + 5.5 * CM
PrintPRO1.CurrentX = startCharLeft + 8 * CM
PrintPRO1.CurrentY = startCharTop + 5 * CM
PrintPRO1.PrintText "日期:"
PrintPRO1.DrawLine starLine + 8 * CM, startCharTop + 5.5 * CM, starLine + 12 * CM, startCharTop + 5.5 * CM
'編號和存根
PrintPRO1.Font.Name = "宋體"
PrintPRO1.Font.Bold = False
PrintPRO1.Font.Size = 18
PrintPRO1.Alignment = ALIGN_RightJustifyMiddle ' Center justify the text
prWidth = PrintPRO1.PWidth
PrintPRO1.PrintTextAligned sNo, 0, startCharTop - 1 * CM, prWidth - 3 * CM, startCharTop
PrintPRO1.Alignment = ALIGN_LeftJustifyMiddle ' Center justify the text
PrintPRO1.CurrentX = startCharLeft - CM
PrintPRO1.CurrentY = startCharTop + 1.2 * CM
PrintPRO1.PrintText "存"
PrintPRO1.CurrentX = startCharLeft - CM
PrintPRO1.CurrentY = startCharTop + 3.2 * CM
PrintPRO1.PrintText "根"
PrintPRO1.EndPrintDoc
Next i
Screen.MousePointer = 0
PrintNotes = True
Else
PrintNotes = False
End If
End Function
'擴充字符串到指定長度
Private Sub AddSpace(s As String, ByVal nLeng As Integer)
Dim i As Integer
s = Trim(s)
i = nLeng - Len(s)
If i > 0 Then
s = s & Space(i)
End If
End Sub
Private Sub Command4_Click()
'Call PrintNotes("No 0032031", "港務局6段", "張宏林", "冀C78964", "文化路北口崗", "2000年12月30日20點45分10秒", "闖紅燈", "2000年12月21日", "f:\t.bmp", "桑塔納轎車")
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -