ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Framework.Contracts Namespace / ComboBox Class
Members

In This Topic
    ComboBox Class
    In This Topic
    Represents a selection control with a drop-down list that can be shown or hidden by clicking the arrow on the control. This is an abstract class.
    Syntax
    public abstract class ComboBox : PlugIn, System.ComponentModel.INotifyPropertyChanged  
    Public MustInherit Class ComboBox 
       Inherits PlugIn
       Implements System.ComponentModel.INotifyPropertyChanged 
    Remarks

    All ribbon control elements share several attributes. The loadOnClick attribute determines when the control should be created by the framework. By default, controls appear enabled, but are not actually instantiated until they are clicked. This simple just-in-time (JIT) strategy improves resource utilization and startup time by deferring the instantiation of controls until they are initiated by the end user. Note that non-visible controls are never loaded until they become visible (or are executed programmatically), regardless of the value assigned to loadOnClick.

    Tooltips are defined using the tooltip sub-element and may span as many lines as necessary. The image attribute is used to supply an image that will appear next to the tip text. Command tooltips also support a disabledText element, this string is additional displayed when the command is disabled.

    Most controls support multiple sizes in the ribbon. For example, a button can render small (small icon only), medium (small icon with text), and large (large icon over text). Use the smallImage and largeImage attributes to specify unique images for the different sizes. Images don’t have to be graphics, you can also use XAML. You can also use overlayLargeImage and overlaySmallImage to draw a graphic or XAML overtop of the corresponding images. If the image should flip when running right-to-left, e.g. arrow buttons, set the flipImageRTL attribute to true.

    The disableIfBusy element is used to signal that the control should be disabled whenever the primary worker thread is busy. This prevents work from queuing up. This element is true by default. Controls that always need to be enabled such as the close application button should set this to false.

    All control declarations support a condition attribute allowing the assignment of a condition. If the specified condition isn’t met, the control will be automatically disabled by the framework. In addition, controls remain unloaded until their is met. If no condition is specified, the control is assumed to be always relevant.

    The ComboBox allows the user to select an item from a drop-down list or optionally to enter new text in the text box of the control. A ComboBox can contain a collection of objects of any type (such as string or image).

    The IsEditable and IsReadOnly attributes specify how the ComboBox behaves.

    IsReadOnly true IsReadOnly false
    IsEditable true
    • Cannot select an item in the ComboBox by entering a string.
    • Cannot enter a string that does not correspond to an item in the ComboBox.
    • Can select part of the string in the ComboBox text box.
    • Can copy the string in the ComboBox text box, but cannot paste a string into the ComboBox text box.
    • Can select an item in the ComboBox by entering a string.
    • Can enter a string that does not correspond to an item in the ComboBox.
    • Can select part of the string in the ComboBox text box.
    • Can copy or paste the string in the ComboBox text box.
    IsEditable false
    • Can select an item in the ComboBox by entering a string.
    • Cannot enter a string that does not correspond to an item in the ComboBox.
    • Cannot select part of the string in the ComboBox.
    • Cannot copy or paste the string in the ComboBox.
    • Can select an item in the ComboBox by entering a string.
    • Cannot enter a string that does not correspond to an item in the ComboBox.
    • Cannot select part of the string in the ComboBox.
    • Cannot copy or paste the string in the ComboBox.

    Declaring ComboBoxes in DAML:

                <comboBox id="acme_cityComboBox" 
                         caption="Cities" 
                         isEditable="false"
                         isReadOnly="true"
                         isTextSearchEnabled="true"
                         editHint="Select a city..." 
                         className="CityComboBox" 
                         sizeString="areallylongcityname" 
                         image="pack://application:,,,/Acme;component/Images/Cities16.png">
                  <tooltip heading="Major Cities">Select a major city.</tooltip>
                </comboBox>
                

    DAML attributes
    id Required identifier.
    caption The text to appear beside the combo box.
    extendedCaption A more descriptive title.
    dataTemplateFile The path to the file containing the custom item template
    editHint The text to display when the combo box is empty.
    image An image to optionally show beside the combo box.
    itemHeight Used with the number of rows to calculate the maximum height of the combo box drop-down.
    itemWidth Used to size the combo box if the sizeString is empty.
    isEditable Enables or disables editing of the text in text box. Default is true.
    isReadOnly Sets the selection-only mode, in which the contents of the combo box are selectable but not editable. Default is false.
    resizable Is the combo box drop-down resizable.
    rows The number of rows to show in the combo box drop-down
    templateID The template ID in the dataTemplateFile.
    sizeString The control sizes to accommodate the sizeString.
    isTextSearchEnabled Enables a user to quickly access items in a set by typing prefixes of strings. Default is true.
    categoryRefID Adds combo box to a specific component category.
    condition Automatically disable the combo box if the condition is not satisfied.
    disableIfBusy Automatically disable the combo box if the application is busy. Default true.
    helpContextID The help topic to show.
    className Required class identifier. Optionally include namespace if not in default namespace.
    assembly Assembly name if not in the default assembly.
    publicKeyToken The necessary public key token if the assembly is strongly named.
    version The version of the dll if the assembly is strongly named.

    DAML Child Elements
    tooltip Description of the control.
    content Optional custom XML data when registered in a component category.
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Framework.Contracts.PlugIn
             ArcGIS.Desktop.Framework.Contracts.ComboBox

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also