473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Printer Preferences Dialog

Hi,

I want to change the printer setting before printing,
i.e. using grayscale printing, instead of colorfull printing.
However, I should do it programatically, the users of my program would not
change this property.

Thanks..

Oct 20 '08 #1
1 4295

"Sadık Eser" wrote:
Hi,

I want to change the printer setting before printing,
i.e. using grayscale printing, instead of colorfull printing.
However, I should do it programatically, the users of my program would not
change this property.

Thanks..
Hi,

You can either use your own PrinterSettings when specifying the
PrintDocument or override in the PrintPage event.

PrintDocument doc = new PrintDocument();
PrinterSettings settings = new PrinterSettings();
settings.DefaultPageSettings.Color = false;
doc.PrinterSettings = settings;
doc.PrintPage += new PrintPageEventHandler(doc_PrintPage);
doc.Print();

.... or ...

void doc_PrintPage(object sender, PrintPageEventArgs e)
{
e.PageSettings.Color = false;
e.Graphics.DrawString("Hello world", Font, Brushes.Magenta, new
Point(50, 50));
}

Either way should print "Hello world" in gray.

--
Happy Coding!
Morten Wennevik [C# MVP]

Oct 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Patrick Herb | last post by:
Hello, I'm trying to print the content of a RichTextBox from my VB 6 app. What I want is that the CommonDialog shows up, the user selects a printer and the content of the RichTextBox prints to...
0
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and...
2
by: Eagle | last post by:
Is there any way to make a print button on a form show the printer properties dialog before actual printing the report linked to the command button in AC97 ? I've noticed that opening the report...
1
by: TD | last post by:
I created a new toolbar for my reports and need a button on it that opens (I'm not sure what the offical name of this window is) the Windows printer window where you can select which printer to...
13
by: Matt | last post by:
Hello, Im creating a Web Browser in Visual C# and I have a preferences dialog. The current homepage is yahoo.com. The code for the homepage is: // Go Home - go to the default home page....
0
by: **Developer** | last post by:
I know this is not the correct NG but I've been trying to get this answered for a while and can't find someone really knowledgeable about printers. (Actually it does relate to something I'm...
1
by: Ed Sutton | last post by:
My C# app. apparently has problems with PageSettings not being initialized properly after calling PageSetupDialog. If a user selects a non-default printer from PageSetupDialog, the PageSize is...
0
by: Academic | last post by:
I posted this in the vb group but it is a pretty esoteric question and I did not get a reply. I'm hoping someone here has some experience generating custom printer forms. If I generate a new...
1
by: pradeeppj | last post by:
i am a software engineer working on UNIDRV printer driver using Microsoft Plug-ins IPRINTOEMUI & IPRINTOEMUNI using VC++ as editor, OS win 2000 server. i am using NTDDK driver development kit. i...
1
by: =?Utf-8?B?T21lZ2FTcXVhcmVk?= | last post by:
have customized PageSetup and Print dialogs that emulate the standard dialogs. I would like to be able to open the "Printer Preferences" dialog by clicking a button (just like can be done on the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.