Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using below code.... for print a document
C#
PrintDocument printDoc = new PrintDocument();
            printDoc.PrinterSettings.PrinterName = printerName;
            if (!printDoc.PrinterSettings.IsValid)
            {
                string msg = String.Format("Can't find printer \"{0}\".", printerName);
                Console.WriteLine(msg);
                return;
            }

and error is ".printersettings" not in intellisense


my error is shown like this...

'XXXXXXX.PrintDocument' does not contain a definition for 'PrinterSettings' and no extension method 'PrinterSettings' accepting a first argument of type 'XXXXXXX.PrintDocument' could be found (are you missing a using directive or an assembly reference?


can u help me???
Posted
Updated 22-May-13 18:32pm
v3

check whether any file name with PrintDocument....
 
Share this answer
 
Is your class name is PrintDocument?
 
Share this answer
 
Comments
Balasubramanian T 23-May-13 7:02am    
Yeah...Problem is in my classfile. one class file is in the name of PrintDocument.cs
Dominic Abraham 23-May-13 7:42am    
:-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900