CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: print function

  1. #1
    Guest

    print function

    I have a picture box name picDisplay, and am sending data to it that you can see. How can I print the data in the picture box? I have tried picDisplay. print and printpicDisplay, but neither of these works. I know how to print the entire form, but that's not what I want.

    Tahnks!



  2. #2
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: print function

    Add this code to a module:

    public Sub PrintPicture(Prn as Printer, Pic as Picture)
    on error GoTo ErrorRoutineErr

    Prn.PaintPicture Pic, 0, 0

    ErrorRoutineResume:
    Exit Sub
    ErrorRoutineErr:
    MsgBox "Project1.Module1.PrintPicture" & Err & error
    resume next
    End Sub




    Then, add this code at the cmdPrint_click() event:

    PrintPicture Printer, Picture1.Picture
    Printer.EndDoc



    All right?

    Michael Vlastos
    Automation Engineer
    Company Modus SA
    Development Department
    Athens, Greece

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