Private Sub PRING_Click() 'On Error GoTo KKKDim intI As Long For intI = 0 To Me.Controls.Count - 1 If TypeName(Me.Controls(intI)) = "TextBox" Then Me.Controls(intI).Appearance = 0 Me.Controls(intI).BorderStyle = 0 End If Next intI On Error GoTo KKK Dim sx As Long, sy As Long, hDC As Long Dim px As Long, py As Long, I As Integer
Me.ScaleMode = vbPixels
sx = Me.Width / Screen.TwipsPerPixelX sy = Me.Height / Screen.TwipsPerPixelY PicPrint.Width = sx PicPrint.Height = sy For I = 0 To Controls.Count - 1 If TypeName(Controls(I)) = "Menu" Then Controls(I).Visible = False If TypeName(Controls(I)) = "PictureBox" Then Controls(I).Visible = False Next DoEvents Text1(12).Visible = True Text1(12).SetFocus PicPrint.AutoRedraw = True
hDC = GetWindowDC(Me.hwnd) BitBlt PicPrint.hDC, -2, -2, sx, sy, hDC, 0, 0, vbSrcCopy ReleaseDC Me.hwnd, hDC PicPrint.AutoRedraw = False For I = 0 To Controls.Count - 1 If TypeName(Controls(I)) = "Menu" Then Controls(I).Visible = True Next Set PicPrint.Picture = PicPrint.Image
Dim w As Long, h As Long Printer.Orientation = vbPRORLandscape Me.ScaleMode = vbTwips Printer.ScaleMode = vbTwips w = PicPrint.Width * n \ 100 h = PicPrint.Height * n \ 100 px = (Printer.ScaleWidth - w) / 2 py = (Printer.ScaleHeight - h) / 2 Printer.PaintPicture PicPrint.Picture, px, py, w, h Printer.EndDoc For intI = 0 To Me.Controls.Count - 1 If TypeName(Me.Controls(intI)) = "TextBox" Then Me.Controls(intI).Appearance = 0 Me.Controls(intI).BorderStyle = 1 End If Next intI Exit Sub KKK: MsgBox "打印机连接错误!", vbOKOnly, warning End SubN为放大倍数 【我不是流氓~~~~~~~才怪!】
'On Error GoTo KKKDim intI As Long
For intI = 0 To Me.Controls.Count - 1
If TypeName(Me.Controls(intI)) = "TextBox" Then
Me.Controls(intI).Appearance = 0
Me.Controls(intI).BorderStyle = 0
End If
Next intI
On Error GoTo KKK
Dim sx As Long, sy As Long, hDC As Long
Dim px As Long, py As Long, I As Integer
Me.ScaleMode = vbPixels
sx = Me.Width / Screen.TwipsPerPixelX
sy = Me.Height / Screen.TwipsPerPixelY
PicPrint.Width = sx
PicPrint.Height = sy
For I = 0 To Controls.Count - 1
If TypeName(Controls(I)) = "Menu" Then Controls(I).Visible = False
If TypeName(Controls(I)) = "PictureBox" Then Controls(I).Visible = False
Next
DoEvents
Text1(12).Visible = True
Text1(12).SetFocus
PicPrint.AutoRedraw = True
hDC = GetWindowDC(Me.hwnd)
BitBlt PicPrint.hDC, -2, -2, sx, sy, hDC, 0, 0, vbSrcCopy
ReleaseDC Me.hwnd, hDC
PicPrint.AutoRedraw = False
For I = 0 To Controls.Count - 1
If TypeName(Controls(I)) = "Menu" Then Controls(I).Visible = True
Next Set PicPrint.Picture = PicPrint.Image
Dim w As Long, h As Long
Printer.Orientation = vbPRORLandscape
Me.ScaleMode = vbTwips
Printer.ScaleMode = vbTwips
w = PicPrint.Width * n \ 100
h = PicPrint.Height * n \ 100
px = (Printer.ScaleWidth - w) / 2
py = (Printer.ScaleHeight - h) / 2
Printer.PaintPicture PicPrint.Picture, px, py, w, h
Printer.EndDoc
For intI = 0 To Me.Controls.Count - 1
If TypeName(Me.Controls(intI)) = "TextBox" Then
Me.Controls(intI).Appearance = 0
Me.Controls(intI).BorderStyle = 1
End If
Next intI
Exit Sub
KKK:
MsgBox "打印机连接错误!", vbOKOnly, warning
End SubN为放大倍数
【我不是流氓~~~~~~~才怪!】
================================================================
[email protected]