Results 1 to 8 of 8

Thread: printing

  1. #1

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123

    printing

    I am using printdialog to print, What i need to know is how do iget the printer to print the number of copies input by the user on the printdialog form?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

  3. #3

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    I looked at the above but I'm still not sure where to use or place copies in my code in order to get it to print multiple copies.

  4. #4
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    I created a PrintDocument withevents called pdoc. I wrote some code for the PrintPage event, some e.graphics to have something to print. I then called the print method of the pdoc object like this....

    Code:
    pdoc.PrinterSettings.Copies = CType(TextBox1.Text, Short)
    pdoc.Print()
    ... and that generated the amount of copies written in TextBox1.

  5. #5

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    what is the textbox1.text refering to? (The Printdialog number of copies textbox?)

  6. #6
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    It was just a textbox where to write the number of copies, but if you mean to use the built in box on the print dialog, you don't have to do anything, do you?

  7. #7
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    Code:
    Private Sub btnPrintDialog_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles btnPrintDialog.Click
    
        Dim dialog As New PrintDialog()
        dialog.Document = pdoc
    
        If dialog.ShowDialog = DialogResult.OK Then
            pdoc.PrinterSettings.Copies = dialog.PrinterSettings.Copies
            pdoc.Print()
        End If
    End Sub
    Sorry, but I probably missunderstodd you....
    Last edited by Athley; Nov 29th, 2002 at 04:15 PM.

  8. #8

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    Thanks thats exactly what I was looking for!

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