Re: printing using tabs
- From: Mitch5713 <mitch@xxxxxxxx>
- Date: Tue, 25 Jul 2006 14:34:02 -0700
Mike: Thankl you for your help... ok seems like alot for just some stupid
text boxes that reside o0n the two tabs. How would you do the layout. The
form I'm trying to reproduce is double sided??? It consissts of nothing but
text boxes and some combo boxes for user selections. I just need to send them
to the printer in duplex mode!!!!! What about creating two pages???
I know theres a simple answer for this but I to much of a novice to know
anything!!!
MItch
"Mike Williams" wrote:
.. . . oops! Missed a NewPage in the code I just posted. As it stands the.
secondTab will be printed on top of the first. Here's the correct code,
which should print two pages for you:
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_PAINT = &HF
Private Const WM_PRINT = &H317
Private Const PRF_CLIENT = &H4&
Private Const PRF_CHILDREN = &H10&
Private Const PRF_OWNED = &H20&
Private Sub Form_Load()
With picTemp
.AutoRedraw = True
.BorderStyle = 0
.BackColor = vbWhite
.Visible = False
End With
End Sub
Private Sub Command1_Click()
Dim retval As Long, oldmode As Long
oldmode = Me.ScaleMode
Me.ScaleMode = vbTwips
Printer.Print ""
'
picTemp.Width = picPrint1.Width
picTemp.Height = picPrint1.Height
DoEvents
retval = SendMessage(picPrint1.hwnd, WM_PAINT, picTemp.hdc, 0)
retval = SendMessage(picPrint1.hwnd, WM_PRINT, picTemp.hdc, _
PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
Printer.PaintPicture picTemp.Image, 0, 0
'
Printer.NewPage
picTemp.Width = picPrint2.Width
picTemp.Height = picPrint2.Height
DoEvents
retval = SendMessage(picPrint2.hwnd, WM_PAINT, picTemp.hdc, 0)
retval = SendMessage(picPrint2.hwnd, WM_PRINT, picTemp.hdc, _
PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
Printer.PaintPicture picTemp.Image, 0, 0
'
Printer.EndDoc
Me.ScaleMode = oldmode
End Sub
- Follow-Ups:
- Re: printing using tabs
- From: Mike Williams
- Re: printing using tabs
- References:
- Re: printing using tabs
- From: Ken Halter
- Re: printing using tabs
- From: Mike Williams
- Re: printing using tabs
- Prev by Date: Re: File Mangement
- Next by Date: Re: VB6 and VB.net on the same machine
- Previous by thread: Re: printing using tabs
- Next by thread: Re: printing using tabs
- Index(es):
Relevant Pages
|