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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top