-
Notifications
You must be signed in to change notification settings - Fork 1
ObLabelComboBoxImage Class
Mauricio Jorquera edited this page Feb 10, 2026
·
2 revisions
Namespace: SCADtools.Revit.UI.OptionsBar
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.
The following example creates a ObLabelComboBoxImage.
C#
ObLabelComboBoxImage labelComboBoxImage = new ObLabelComboBoxImage()
{
ItemsTextImage = GetRebarImages(),
ControlWidth = 220
};
private ObservableCollection<ComboBoxItemTextImage> GetRebarImages()
{
string title = "Rebar Shape : ";
string imageBaseUri = "pack://application:,,,/OptionsBarSample;component/Images/";
string[] shapes = { "B1", "B2", "B3" };
return new ObservableCollection<ComboBoxItemTextImage>(
shapes.Select(shape => new ComboBoxItemTextImage
{
ItemTitle = title,
ItemText = shape,
ItemImage = new BitmapImage(
new Uri($"{imageBaseUri}{shape}.png", UriKind.Absolute)),
IsVisibleImageCollapsed = true
})
);
}| Name | Description |
|---|---|
| ObLabelComboBoxImage() | Initializes a new instance of the ObLabelComboBoxImage class. |
| Name | Description |
|---|---|
| ControlWidth | Gets or sets the width of the ComboBox. |
| ObExpandedToolTip | This class implements the standard tooltip. |
| ItemsTextImage | Gets or sets a collection used to generate the content of the ObLabelComboBoxImage. |
| 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 selected item. |
| SelectedItem | Gets or sets the currently selected item. |