Skip to content

LabelComboBoxImage Class

Mauricio Jorquera edited this page Nov 14, 2023 · 10 revisions

Description

Namespace: SCADtools.Revit.UI

This class is used to add an element that combines a ComboBox with a Label to the options bar. Allows incorporating images into its elements. Each item within the ComboBox can include both images and descriptive text.

Example

The following example creates a LabelComboBoxImage.

C#

List<ComboBoxItemTextImage> comboBoxItemsTextImage = new List<ComboBoxItemTextImage>()
{
    new ComboBoxItemTextImage() { ItemTitle = "Rebar Shape : ", ItemText = "B1",
           ItemImage = new BitmapImage(new Uri("pack://application:,,,/OptionsBarSample;component/Images/B1.png",
                                               UriKind.Absolute)),
           IsVisibleImageCollapsed = true },
    new ComboBoxItemTextImage() { ItemTitle = "Rebar Shape : ", ItemText = "B2",
           ItemImage = new BitmapImage(new Uri("pack://application:,,,/OptionsBarSample;component/Images/B2.png",
                                               UriKind.Absolute)),
           IsVisibleImageCollapsed = true },
    new ComboBoxItemTextImage() { ItemTitle = "Rebar Shape : ", ItemText = "B3",
           ItemImage = new BitmapImage(new Uri("pack://application:,,,/OptionsBarSample;component/Images/B3.png",
                                               UriKind.Absolute)),
           IsVisibleImageCollapsed = true }
};
LabelComboBoxImage labelComboBoxImage = new LabelComboBoxImage()
{
    ShowLabel = false,
    ItemsTextImage = comboBoxItemsTextImage,
    ComboBoxWidth = 220,
};

Constructors

Name Description
LabelComboBoxImage() Initializes a new instance of the LabelComboBoxImage class.

Properties

Name Description
ComboBoxControl Represents a native ComboBox class.
ComboBoxWidth Gets or sets the width of the ComboBox.
ControlToolTip This class implements the standard tooltip.
ItemsTextImage Gets or sets a collection used to generate the content of the LabelComboBoxImage.
Label The user-visible text on the Label.
MarginLeft Gets or sets the separation of the Control with some control that is to its left.
ShowLabel Gets or sets the value indicating whether the label text is visible.
SelectedIndex Gets or sets the index of the first item in the current selection.