Results 1 to 18 of 18

Thread: [HELP] Printing Picture box

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    [HELP] Printing Picture box

    see, i am making a project that prints. but its too long for a form so i added it on a picture box so i can use a scroll, not, my problem is. when i print it, only the form size is printed? i use "Form1.PrintForm" but it wont work. can anybody help me? please please please i need help from IT experts in here. here is my sample of my project

    Download Link:

    http://www.mediafire.com/?7z4d02yl028yblf

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    i need help please....... im using VB 6

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [HELP] Printing Picture box


  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [HELP] Printing Picture box

    check out the project from microsoft for printing forms etc, has a function to print picturebox to page size
    http://support.microsoft.com/default...b;en-us;161299
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    i dont understand. can anybody edit or teach me where to put those codes?

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    anyone can teach me where to put the codes? here's the ink of the code http://www.andreavb.com/tip070013.html

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [HELP] Printing Picture box

    did you try creating a new project and adding the controls suggested and this code?

    it is mostly correct though the api declares should be declared public if they are put in a module with the printpicturebox procedure
    in fact all the code could go into a form as is

    just get it working in a new project before trying to add to your existing project
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    i dont understand it

    can somebody make a demo for me? or a sampe project. please....... this is just important

  9. #9

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    Help please....

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [HELP] Printing Picture box

    don't bump your threads

    why do you expect someone else to do for you?
    we have already googled for you
    there are 2 sample method to what you have asked, i have not tested the one from andreavb, which looks very simple to incorporate into any project, but i have tested the microsoft one and it works correctly and has many more options

    if you show what code you have done so far and what parts are giving problem you will get plenty of help,

    if you do not want to do any of this yourself, you could try the rentacoder site and pay someone to do for you
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  11. #11

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    well, i dont understand it. where to find module

  12. #12
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [HELP] Printing Picture box

    add a module
    menu > project > addmodule
    just select default module in dialog

    in the module, paste all the code, in the first 2 blue areas
    make sure to have a picturebox picture1 can be hidden

    put the code in the 3rd blue box into you print command button, or whatever you are using to print

    i made a project up, to test, in about 3 minutes, from the result i suggest looking more at the microsoft solution i posted above, it gives a much better result, with a lot more options
    it includes fairly comprehensive instructions, as to where to place code, make sure to add all the required controls to the form, you do not need all the code for what you want to do, just the code for capture client and printpicturetofitpage, but as you can paste all just as easy to include all, you can comment out what you don't need after
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  13. #13

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    ok thank you, i will try that one. i will post here if something goes wrong

  14. #14

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    hey it says "Run time error 6, Overflow"? what does that mean? i should reduce the size of the picturebox?

  15. #15
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [HELP] Printing Picture box

    the pictureboxs should, i believe, be set for autosize, i think the code takes care of that
    i did not get an overflow error when i tried either of the projects

    where do you get the overflow error, which line?
    which code are you working with?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  16. #16

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    this one

    Code:
      If Pic.Height >= Pic.Width Then
                Prn.Orientation = vbPRORPortrait   ' Taller than wide.
             Else
                Prn.Orientation = vbPRORLandscape  ' Wider than tall.
             End If
    that bold code was high lighted with yellow,

  17. #17
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [HELP] Printing Picture box

    i do not see any reason why you should get overflow error on that line, i have tested this project with no errors
    does your printer have ability to print landscape and portrait?

    if you know which way you want to print you could just comment out that section of code
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  18. #18

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    13

    Re: [HELP] Printing Picture box

    how? maybe thats the reason

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