Results 1 to 7 of 7

Thread: Need Help Fast!!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Post

    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.

  2. #2
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    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

  3. #3
    New Member
    Join Date
    Oct 1999
    Posts
    2

    Post

    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]

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    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



  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Post

    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.

  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Invisible PictureBox is just a regular PictureBox with the Visible property set to False.


    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819



  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Post

    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
  •  



Click Here to Expand Forum to Full Width