Results 1 to 3 of 3

Thread: Printing a form

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    MyForm.PrintForm

    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

  2. #2
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Post

    Aaron Young gave me this
    Add a Picturebox to your Form..
    code: picturebox1.visible = false


    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()
    Dim W As Integer
    Dim H As Integer
    Dim X As Integer
    Dim Y As Integer
    Dim oX As Single
    Dim oY As Single

    oX = Left
    oY = Top
    W = 400
    H = 400
    Picture1.Move 0, 0, ScaleWidth, ScaleHeight
    For Y = 0 To Int(ScaleHeight / H) + 1
    For X = 0 To Int(ScaleWidth / W) + 1
    Move ScaleX(-X * W, vbPixels, vbTwips), ScaleY(-Y * H, vbPixels, vbTwips)
    DoEvents
    BitBlt Picture1.hDC, X * W, Y * H, W, H, hDC, X * W, Y * H, SRCCOPY
    Next
    Next
    Move oX, oY
    Printer.PaintPicture Picture1.Image, 0, 0
    Printer.EndDoc
    End Sub
    Private Sub Form_Load()
    ScaleMode = vbPixels
    With Picture1
    .Visible = False
    .BorderStyle = vbBSNone
    .ScaleMode = vbPixels
    .AutoRedraw = True
    End With
    End Sub

  3. #3
    New Member
    Join Date
    Jan 2000
    Location
    Spain
    Posts
    8

    Post

    I have a form in an app with a Flexgrid plenty of data I just want to print that form.
    When the user press one button the app have to print the active form. The same the user see in the screen but in paper.
    Which is the simplest way of doing it??
    Do I have to use the printer object??

    Any advice will be greatly apreciatted.

    Nauj

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