|
-
Nov 3rd, 1999, 08:34 AM
#1
Thread Starter
Addicted Member
I want to print my form out like a invoice that cove the whole sheet of paper. I try formprint but it does use the whole page.
In some of my other porgram I was able to use Printer.PaintPicture MSFlexGrid1.Picture, 0, 0, Printer.ScaleWidth to print a MSFlesgrid that work fine. Can somebody help me I've tried using Printer.PaintPicture Form1.Picture, 0, 0, Printer.ScaleWidth but it does not work.
-
Nov 3rd, 1999, 09:30 AM
#2
Hyperactive Member
Can you try making the form the size of the paper minus the margins: (i.e.: width = 7.5in and height = 10in)
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
-
Nov 3rd, 1999, 09:19 PM
#3
New Member
Hi ScottF,first excuse my english
me too i had some problem with the function print of vb,
i but a ACTIVEX it's call PRINTX
http://www.festech.com/
if you want more info E-mail me....
good luck..
[email protected]
-
Nov 3rd, 1999, 10:20 PM
#4
The following code should work. It uses an invisible picturebox called Picture1 and the code to print the form is in the Click event of Command1:
Private Declare Function BitBlt _
Lib "gdi32" ( _
ByVal hDestDC As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
Private Const SRCCOPY = &HCC0020
Private Sub Command1_Click()
BitBlt Picture1.hDC, 0, 0, _
Picture1.Width / Screen.TwipsPerPixelX, _
Picture1.Height / Screen.TwipsPerPixelY, _
Me.hDC, 0, 0, SRCCOPY
Printer.PaintPicture Picture1.Image, 0, 0
Printer.EndDoc
End Sub
Private Sub Form_Load()
'
'you can set these properties a design time
'
With Picture1
.Visible = False
.AutoRedraw = True
.BorderStyle = vbBSNone
End With
End Sub
Private Sub Form_Resize()
With Picture1
.Width = Me.ScaleWidth
.Height = Me.ScaleHeight
End With
End Sub
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
-
Nov 4th, 1999, 08:36 AM
#5
Thread Starter
Addicted Member
What is a invisible picturebox? I know what a picturebox is. Can I place my control, textbox, grids etc. in it. Can you please explain a little more.
-
Nov 4th, 1999, 08:52 AM
#6
Invisible PictureBox is just a regular PictureBox with the Visible property set to False.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 5th, 1999, 10:58 AM
#7
Thread Starter
Addicted Member
I Try it but it does not print a full 8 X 11 page. I can change the resolution of the screen and I can Print a full page.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|