Here is what I really need from SelectedIndex...

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

trint

Ok,
I populate the combobox just once upon page "initializecomponent":

PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count;
i++)
{
pkSource = printDoc.PrinterSettings.PaperSources;
comboBox1.Items.Add(pkSource);
}
Now, I want to programatically select the index value without clicking
on it, because, I know the value! Can I do this?:

PrintDocument printDoc = new PrintDocument();

printDoc.DefaultPageSettings.PaperSource =
printDoc.PrinterSettings.PaperSources[comboBox1.SelectedIndex =
4]; <<<I know it needs to be 4 without selecting it.
Thanks,
Trint
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top