Solved

How to get printer settings of default printer in C#?

Posted on 2006-11-16
3
2,711 Views
Last Modified: 2008-01-09
Hi,

   I am working on page setup form in my application. How can i get user's default printer settings? i need to show page sizes in a combo box..

Thanks
Bekir Karadeniz
0
Comment
Question by:BekirKaradeniz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
ozymandias earned 125 total points
ID: 17958775
// create a print dialog which will be initilaised with default printer
PrintDialog pd = new PrintDialog();
// get the printer settings and get the papersizes
// iterate throught the available paper sizes and add them to your combobox
foreach(PaperSize p in pd.PrinterSettings.PaperSizes){
      comboBox1.Items.Add(p.PaperName);
}
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question