Results 1 to 11 of 11

Thread: Print

  1. #1

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195

    Print

    Why doesn't this code work:


    In "Some" event,


    PrintDialog1.ShowDialog()

    MsgBox(PrintDialog1.PrinterSettings.Copies.ToString)




    I always get a "1" in my message box no matter how many copies I choose on the Print Dialog?

    Why?

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I believe the print dialog is modal, so you will hit your messagebox when the user is complete with it (after printing), so you are probably getting the default value.

  3. #3
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    I'm having the same problem, and no one has been able to help me.
    If I set the Copies property to another number before opening the dialog, my number is shown in the dialog ok, but when clicking ok, without making any changes, the property is reset to 1.

    I think there may be a bug in the printdialog, but I have not been able to confirm that, neither here or at MSDN.

    So if someone knows what to do, I would really like to hear about it.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  4. #4

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    I was just using a message box to check the value of "Copies", to see what the printer was recieving.

    If you have to set the number of copies before you see the dialog, what good is the dialog?

    Someone has to know a solution. I can't believe everyone just print one copy of everything.

    P.S.
    Is it just me or is printing in .net a complete pain in the ***?

  5. #5
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159
    Hi,

    I am finding the same problem.

    I have a print dialog and no matter what you select in the copies box it is never accessible after the dialog is closed.

    I think it must be a bug......

    DJ

    P.S. I think that printing in .NET is quite easy actually! Not as easy as VB6 (printer.print..... ahhh they were the days) but you do get quite a lot of control which is easier than it was before....

  6. #6
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hole-In-One: Setting the number manually before opening the dialog, was just for testing purposes, but It could be that you wanted a default number of copies other than 1. Either way, the return value is allways 1.

    Besides, I don't think it has anything to do with dialog being closed, because the rest of the properties are OK.
    Also, I dont see any other way of getting the properties, since the dialog is modal, and we only get control after the dialog is closed.

    But you're right that someone must have found a solution for this. At least a lot of people should have experienced this.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  7. #7
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159
    Hi,

    Can you guys let me know what version of the framework you are on? I am thinking that maybe a later version may have this issue solved? I am running version 1.0.3705.

    Thanks,
    DJ

  8. #8
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    Same here...
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  9. #9

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Same


    There must be a fix?

    At least you would hope so!

  10. #10
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148
    It is a known issue and should be fixed in the next version of the framework.

  11. #11

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    So The Framework Service Pack 2 dosn't contain the fix?

    It should be in Service Pack 3, if I'm understanding you correctly.

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