Enumerates the paper sizes supported by the specified printer.
The following code fills a combo box with the paper size for the selected printer index:
ArrayList arrComboItems = new ArrayList();
PaperSize paperSize = ChartControl.PrintManager.EnumeratePaperSizes(currentPrinter, arrComboItems);
for (int i = 0; i < arrComboItems.Count; i++)
{
if ((String)arrComboItems[i] == paperSize.PaperName)
selectedIndex = i;
PaperSizeComboBox.Items.Add((String)arrComboItems[i]);
}
if (selectedIndex != -1)
PaperSizeComboBox.SelectedIndex = selectedIndex;
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2