Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.v4.4 Assembly / Xceed.Chart Namespace / PrintManager Class / EnumeratePaperSources Method
Example


In This Topic
    EnumeratePaperSources Method
    In This Topic
    Enumerates the paper sources supported by the specified printer.
    Syntax
    'Declaration
     
    Public Function EnumeratePaperSources( _
       ByVal printerIndex As Integer, _
       ByVal paperSources As ArrayList _
    ) As PaperSource
    'Usage
     
    Dim instance As PrintManager
    Dim printerIndex As Integer
    Dim paperSources As ArrayList
    Dim value As PaperSource
     
    value = instance.EnumeratePaperSources(printerIndex, paperSources)
    public PaperSource EnumeratePaperSources( 
       int printerIndex,
       ArrayList paperSources
    )

    Parameters

    printerIndex
    paperSources
    Example
    The following code fills a combo box with the supported paper sources:
    ArrayList arrComboItems = new ArrayList();
    PaperSource defaultPaperSource = ChartControl.PrintManager.EnumeratePaperSources(currentPrinter, arrComboItems);
    
    for (int i = 0; i < arrComboItems.Count; i++)
    {
       if ((String)arrComboItems[i] == defaultPaperSource.SourceName)
         selectedIndex = i;
         
      PaperSourceComboBox.Items.Add((String)arrComboItems[i]);
    }
    
    if (selectedIndex != -1)
       PaperSourceComboBox.SelectedIndex = selectedIndex;
    Requirements

    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

    See Also