ComboBox Class
Definition
Section titled “Definition”Represents a button that can be toggled on/off within a group of other buttons.
[DataContract]public class ComboBox : CheckBoxInheritance object → ControlBase → ButtonBase → ToggleButtonBase → CheckBox
Constructors
Section titled “Constructors”ComboBox(int, int, int, object[])
Section titled “ComboBox(int, int, int, object[])”Creates a new instance of the combobox control.
public ComboBox(int width, int dropdownWidth, int dropdownHeight, object[] items)Parameters
Section titled “Parameters”width int
The width of the control.
dropdownWidth int
The width of the dropdown container.
dropdownHeight int
The height of the dropdown container.
items object[]
The items to seed the dropdown with.
Fields
Section titled “Fields”DropdownContainer
Section titled “DropdownContainer”Surface that contains the listbox
protected readonly ScreenSurface DropdownContainerListBox
Section titled “ListBox”Listbox used to control the items
protected readonly ListBox ListBoxProperties
Section titled “Properties”SelectedIndex
Section titled “SelectedIndex”Gets or sets the index of the selected item.
public int SelectedIndex { get; set; }SelectedItem
Section titled “SelectedItem”Gets or sets the selected item.
public object? SelectedItem { get; set; }PopupInnerAligned
Section titled “PopupInnerAligned”When true, uses the PopupHorizontal value from the interior of the control. When false, it’s used from the outside of the control.
[DataMember]public bool PopupInnerAligned { get; set; }PopupHorizontal
Section titled “PopupHorizontal”Sets the horizontal orientation of the of the dropdown popup.
[DataMember]public HorizontalAlignment PopupHorizontal { get; set; }PopupVertical
Section titled “PopupVertical”Sets the vertical orientation of the of the dropdown popup.
[DataMember]public VerticalAlignment PopupVertical { get; set; }CollapsedButtonGlyph
Section titled “CollapsedButtonGlyph”The glyph to use on the control when it’s collapsed.
[DataMember]public int CollapsedButtonGlyph { get; set; }ExpandedButtonGlyph
Section titled “ExpandedButtonGlyph”The glyph to use on the control when it’s expanded.
[DataMember]public int ExpandedButtonGlyph { get; set; }Methods
Section titled “Methods”ResizeDropDown(int?, int?)
Section titled “ResizeDropDown(int?, int?)”Resizes the dropdown container to the given width/height
public void ResizeDropDown(int? width = null, int? height = null)Parameters
Section titled “Parameters”width int?
Width of the dropdown
height int?
Height of the dropdown
SetItems(params object[])
Section titled “SetItems(params object[])”Sets the items in the dropdown listbox.
public void SetItems(params object[] items)Parameters
Section titled “Parameters”items object[]
The items to set.
GetItems()
Section titled “GetItems()”Gets an array of items from the dropdown listbox.
public object[] GetItems()Returns
Section titled “Returns”RepositionOffScreenContainer()
Section titled “RepositionOffScreenContainer()”Checks if the dropdown container is off-screen, and pushes it back in.
protected void RepositionOffScreenContainer()OnIsSelected()
Section titled “OnIsSelected()”When IsSelected is true, displays the popup container. When false, hides the popup container.
protected override void OnIsSelected()RefreshThemeStateColors(Colors)
Section titled “RefreshThemeStateColors(Colors)”Updates the ThemeState by calling RefreshTheme(Colors) with the provided colors. Override this method to adjust how colors are used by the ThemeState.
protected override void RefreshThemeStateColors(Colors colors)Parameters
Section titled “Parameters”colors Colors
The colors to apply to the theme state.
UpdateAndRedraw(TimeSpan)
Section titled “UpdateAndRedraw(TimeSpan)”Redraws the control if applicable.
public override void UpdateAndRedraw(TimeSpan time)Parameters
Section titled “Parameters”time TimeSpan
The duration of thecurrent frame.
Events
Section titled “Events”SelectedItemChanged
Section titled “SelectedItemChanged”An event that triggers when the SelectedItem property changes.
public event EventHandler<ListBox.SelectedItemEventArgs>? SelectedItemChanged