Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

finding and displaying the default printerr on a win form

I am looking for code that finds the default printer when a user opens a winform.
0
abobby2005
Asked:
abobby2005
1 Solution
 
Joe_GriffithCommented:
A new print document will, by default, be associated with the default printer. Therefore the easiest way to find the default printer is to instantiate a new print document and look at its printer:

    Imports System.Drawing.Printing
    .
    .
    Dim x As New PrintDocument
    MessageBox.Show(x.PrinterSettings.PrinterName)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now