And need help with 'PrinterSettings.PaperSources'...

  • Thread starter Thread starter trint
  • Start date Start date
T

trint

Can someone help me to get this code to work...I'm unsure what the
'printDoc' variable is supposed to be?

// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that
will provide the display string.
comboPaperSource.DisplayMember="SourceName";

PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count; i++){
pkSource = printDoc.PrinterSettings.PaperSources;
comboPaperSource.Items.Add(pkSource);
}

Thanks,
Trint
 
It's just a Printer Document:

PrintDocument printDoc = new PrintDocument();

Although, in your case you don't seem to be using the document. If all
you need are the Printer Settings, just try:

PrinterSettings.PaperSources
Make sure to add:

using System.Drawing.Printing;


Joseph
 
Back
Top