CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    3

    Print Text and Form

    I want to print some text and a form on the same sheet. With this code, the text is never printed :

    Printer.print "Bhla bhla"
    frmPrint.PrintForm
    Printer.EndDoc



    I could use Printer.PaintPicture, but I don't know how to turn my Form into a Picture...

    Anybody could help me ?


  2. #2
    Join Date
    Jun 2001
    Location
    Israel
    Posts
    228

    Re: Print Text and Form

    have you tried : Form1.PrintForm method?

    ----------
    The @host is everywhere!
    ----------

  3. #3
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    3

    Re: Print Text and Form

    Yes... e.g. :

    Printer.print "My Title"
    Form1.PrintForm




    Form1 is Printed but not the text I want to print on the same sheet (Ie.: "My title") ???



  4. #4
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    3

    Re: Print Text and Form

    Here is my own temporary solution. Actually, it prints the MDI window. I want to print one of the Child windows...

    Clipboard.Clear
    DoEvents
    keybd_event VK_MENU, 0, 0, 0
    DoEvents
    keybd_event VK_SNAPSHOT, 0, 0, 0
    DoEvents
    keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
    DoEvents

    Printer.print "My Title"
    Printer.print

    Printer.PaintPicture Clipboard.GetData(vbCFBitmap), 0, 1500

    Printer.EndDoc




    PS.: keybd_event is a call to the API (lib user32)
    It emulates a "Alt-Print Scrn"


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

Featured