Click to See Complete Forum and Search --> : Need Help Fast!!!
ScottF
Nov 3rd, 1999, 07:34 AM
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.
Compwiz
Nov 3rd, 1999, 08:30 AM
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
tom@e-bizinternet.com
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
shtplus
Nov 3rd, 1999, 08:19 PM
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..
shtplus@hotmail.com
Joacim Andersson
Nov 3rd, 1999, 09:20 PM
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
joacim@programmer.net
joacim@yellowblazer.com
www.YellowBlazer.com (http://www.YellowBlazer.com)
ScottF
Nov 4th, 1999, 07:36 AM
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.
Serge
Nov 4th, 1999, 07:52 AM
Invisible PictureBox is just a regular PictureBox with the Visible property set to False.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819
ScottF
Nov 5th, 1999, 09:58 AM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.