Skip to content

ComboBoxItemText Class

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

Description

Namespace: SCADtools.Revit.UI

This class represents an item within the LabelComboBox class and has two properties: ItemTitle and ItemText.

Example

The following example creates a list of bar types and assigns it to the ItemText property of the LabelComboBox object.

C#

List<ComboBoxItemText> comboBoxItemTexts = new List<ComboBoxItemText>()
{
    new ComboBoxItemText () { ItemTitle = "Type : ", ItemText = "B1a" },
    new ComboBoxItemText () { ItemTitle = "Type : ", ItemText = "B1b" }
};
LabelComboBox labelComboBox = new LabelComboBox()
{
    ShowLabel = false,
    ItemsText = comboBoxItemTexts
};

Properties

Name Description
ItemTitle Gets or sets a title for the selected item to be displayed when the combobox is collapsed.
ItemText Gets or sets the text associated with the selected item, which will be displayed in the expanded list when the combobox is dropped down.

Remarks

If the user does not want to display text in the ItemTitle property, they can leave it unassigned or set its value to empty.