Groups | Blog | Home
all groups > vb.net controls > september 2004 >

vb.net controls : How do I check if printer exists ?


Dino Buljubasic
9/1/2004 5:47:02 PM
I use in my code:

ConstLeftMargin =
PrintDocument1.PrinterSettings.DefaultPageSettings.PaperSize.height\40

to set left margin for my document.

However, when printer is uninstalled,it crashes.


How do I check if printer exists before accessing PrinterSettings
object?

hirf-spam-me-here NO[at]SPAM gmx.at
9/1/2004 7:49:36 PM
* Dino Buljubasic <dino@noplacelikehome.com> scripsit:
[quoted text, click to view]

This sample shows you how to determine the installed printers:

<URL:http://dotnet.mvps.org/dotnet/samples/printing/downloads/PrintingDemo.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button