Class SpeedButtonWithListPopup<T>
Represents a speed button control that displays a popup window containing a virtual list box.
public class SpeedButtonWithListPopup<T> : SpeedButtonWithPopup<PopupListBox<T>, T>, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, ILayoutItem, INotifyDataErrorInfo, ICommandSource where T : VirtualListBox, new()
Type Parameters
TThe type of the virtual list box used within the popup window. Must inherit from VirtualListBox and have a parameterless constructor.
- Inheritance
-
SpeedButtonWithPopup<PopupListBox<T>, T>SpeedButtonWithListPopup<T>
- Implements
- Derived
Remarks
This control combines the functionality of a button and a popup list box, allowing users to select values from a list. The popup window is created lazily when accessed via the PopupWindow property.
Constructors
- SpeedButtonWithListPopup()
Initializes a new instance of the SpeedButtonWithListPopup<T> class.
- SpeedButtonWithListPopup(Control)
Initializes a new instance of the SpeedButtonWithListPopup<T> class.
Fields
- DefaultExpandDropDownMenuToWidth
Gets or sets whether the default behavior is to expand drop-down menu width to match the width of their parent control.
- DefaultExpandedDropDownMenuDecrement
The default decrement value, in chars, used to adjust the size of an expanded drop-down menu.
- DefaultPopupKind
Gets or sets the default kind of popup window used by the control.
- MaxItemsUsingContextMenu
Gets or sets the maximum number of items that can be displayed in the context menu when popup kind is Auto. If the number of items exceeds this value, the control will use a popup window with a list box instead of a context menu.
Properties
- IndexOfValue
Gets the index of the value in the items collection.
- Items
Gets the collection of items used in the list box control within the popup window.
- ListBox
Gets the underlying VirtualListBox control used within the popup window.
- LookupByValue
Gets or sets a value indicating whether to perform lookup by value when popup window is opened.
- LookupExactText
Gets or sets a value indicating whether to perform an exact text lookup when popup window is opened.
- LookupIgnoreCase
Gets or sets a value indicating whether to ignore case when looking up items in the popup window.
- PopupKind
Gets or sets the kind of popup window used by the control. Default is
null. If not set, the DefaultPopupKind is used.
- PopupListBox
Gets attached popup window.
- SimpleItems
Gets simple items where item is
object. It is mapped from Value elements of the Items collection.
- UseContextMenuAsPopup
Gets or sets a value indicating whether to use a context menu as the popup window.
Methods
- Add(ListControlItem)
Adds an item to the list control shown in the popup.
- Add(object)
Adds an item to the list control shown in the popup.
- Add(string, object)
Adds an item to the list control shown in the popup.
- AddEnumValues(Type, object?)
Adds enum values to the items collection.
- AddEnumValues<T2>()
Adds enum values to the items collection.
- AddEnumValues<T2>(T2)
Adds enum values to items collection.
- AddFontNamesAndSelect(bool, string?)
Adds font names to the associated list control and optionally selects a specified font name.
- AddFontSizesAndSelect(bool, float?)
Adds a list of font sizes to the associated list control and optionally selects a specified font size.
- AddRange(IEnumerable)
Adds a collection of items to the list control shown in the popup.
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- FindItemWithValue(object?)
Finds the item with Value property which is equal to the specified value.
- GetItems()
Retrieves a collection of items to be displayed in a list control shown in the popup.
- OnPopupWindowClosed(object?, EventArgs)
Fired after popup window is closed. Applies value selected in the popup window to the control.
- ReloadItems()
Reloads the items in the associated list box.
- SelectFirstItem()
Selects the first item in the list and sets its value to the control.
- ShowPopup()
Shows popup window.
Events
- LookupValue
Occurs when a lookup operation is performed and provides the resulting value. Implementation of this event should lookup 'Value' in the ListBox control and assign index of the found item to result in the event data.