Default printer using System.Drawing.Printing

W

Willem

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top