Default printer using System.Drawing.Printing

Discussion in 'ASP .Net' started by Willem, Nov 27, 2004.

  1. Willem

    Willem Guest

    Hi,

    I'm using System.Drawing.Printing to print some simple
    information.

    Private WithEvents mDoc As New PrintDocument

    The click event on a button has the

    mDoc.Print()

    command, which launch the event to start printing.

    Private Sub mDoc_PrintPage

    e.Graphics.DrawString("Hello", mFont, Brushes.Black,
    xPos, yPos)

    According the MSDN library this code should use the
    default printer. But it doesn't work. When I add the code

    mDoc.PrinterSettings.PrinterName("my printer name")

    it works. But I want to use the default printer of user.
    What is coming wrong?

    Many thanks,

    Willem
     
    Willem, Nov 27, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel Lee
    Replies:
    0
    Views:
    534
    Samuel Lee
    Nov 11, 2003
  2. Replies:
    1
    Views:
    661
    Kevin Spencer
    Jan 9, 2006
  3. Askari
    Replies:
    3
    Views:
    487
    Steve Holden
    Oct 16, 2004
  4. gerb
    Replies:
    2
    Views:
    191
  5. Replies:
    1
    Views:
    106
    Thomas 'PointedEars' Lahn
    Feb 17, 2006
Loading...

Share This Page