Overview

BeepComboBox is a modern, fully themable combo box control built on the BaseControl framework. It uses a painter methodology where each visual variant (ComboBoxType) delegates rendering to a dedicated painter class, enabling consistent styling across 11 design-system variants while sharing core logic for selection, popup management, and keyboard navigation.

The control is implemented across 6 partial class files and supported by 11 painter classes, 5 helper engines, and the shared BeepContextMenu for dropdown popups. It inherits border rendering, DPI scaling, theme application, and hit-testing from BaseControl.

NamespaceTheTechIdea.Beep.Winform.Controls
Base ClassBaseControl
Toolbox CategoryBeep Controls
Designer SupportFull (ToolboxItem, property grid, design-time painting)
RenderingPainter-driven via IComboBoxPainter with immutable ComboBoxRenderState snapshots
AccessibilityFull, via custom AccessibleObject with Value/Role/State overrides

Key Features

11 Visual Variants

OutlineDefault, OutlineSearchable, FilledSoft, RoundedPill, SegmentedTrigger, MultiChipCompact, MultiChipSearch, DenseList, MinimalBorderless, CommandMenu, VisualDisplay — each with dedicated painter and layout tokens.

Painter Methodology

Stateless frame-by-frame rendering: ComboBoxStateFactory snapshots live state into an immutable ComboBoxRenderState, ComboBoxLayoutEngine computes rectangles, and the active painter renders without reaching back into the control.

Multi-Select with Chips

Two dedicated multi-select variants (MultiChipCompact, MultiChipSearch) render selected items as chip tokens with close (×) buttons, overflow count badges (+N), and animated chip add/remove transitions.

Inline Text Editor

When editable or searchable, a BeepTextBox child control overlays the text area for live typing. Supports auto-complete with prefix/fuzzy/full matching modes, free-text tokenization via delimiter characters, and debounced suggestions.

Searchable Popup

Types that support search (OutlineSearchable, MultiChipSearch, CommandMenu) show a search box in the dropdown. The ComboBoxSearchEngine provides prefix, substring, and fuzzy-subsequence matching against both primary text and sub-text.

Loading States

Two distinct loading mechanisms: an animated spinner that replaces the chevron while IsLoading = true, and a shimmer skeleton sweep when ShowSkeleton = true (for async data population).

Validation States

Four validation states (None, Error, Warning, Success) drive border colour, background tint, and trailing status icons (SVG: AlertCircle, AlertTriangle, Check).

RTL & Accessibility

Full right-to-left layout mirroring via IsRtl. Custom AccessibleObject exposes combo box value, role, and expanded/collapsed state to screen readers. Keyboard navigation covers Up/Down/Home/End/PageUp/PageDown/Enter/Escape/Space/Backspace.

ComboBoxType Variants

The ComboBoxType enum defines 11 design-system variants. Each variant maps to a dedicated IComboBoxPainter implementation and a set of ComboBoxVisualTokens (button width, inner padding, corner radius, text inset, row density). Changing ComboBoxType dynamically swaps the painter and re-applies layout defaults.

Enum ValueDescriptionPainter ClassKey TokensSearch?
OutlineDefault = 0Primary enterprise outlined dropdown with hover/focus accent rings.OutlineDefaultComboBoxPainterButtonW:34, Padding:(12,6,8,6), Radius:6, Separator:YesNo
OutlineSearchable = 1Outlined dropdown with inline search box in popup and inline editor support.OutlineSearchableComboBoxPainterButtonW:36, Padding:(12,6,8,6), Radius:6, Separator:YesYes
FilledSoft = 2Soft filled field with subtle background tint and modern density.FilledSoftComboBoxPainterButtonW:36, Padding:(12,8,8,8), Radius:8, IsFilled:YesNo
RoundedPill = 3High-radius pill shell with generous padding.RoundedPillComboBoxPainterButtonW:38, Padding:(16,8,12,8), Radius:18No
SegmentedTrigger = 4Split trigger with visually distinct chevron segment using primary colour fill.SegmentedTriggerComboBoxPainterButtonW:40, Padding:(12,6,8,6), Radius:8, Segmented:YesNo
MultiChipCompact = 5Multi-select chip field with compact token layout; auto-enables AllowMultipleSelection.MultiChipCompactComboBoxPainterButtonW:36, Padding:(10,6,8,6), Radius:8, ChipH:24No
MultiChipSearch = 6Multi-select chips with searchable checkbox popup; auto-enables multi-select + search.MultiChipSearchComboBoxPainterButtonW:36, Padding:(10,6,8,6), Radius:8, ChipH:24, Density:36Yes
DenseList = 7Data-dense list-oriented variant with compact padding and small button.DenseListComboBoxPainterButtonW:28, Padding:(6,3,4,3), Radius:4, Density:30No
MinimalBorderless = 8Low-chrome borderless/minimal shell with smallest button footprint.MinimalBorderlessComboBoxPainterButtonW:22, Padding:(4,6,4,6), Radius:6, Borderless:YesNo
CommandMenu = 9Command-palette style field with inline search editor and popup rows showing shortcut metadata.CommandMenuComboBoxPainterButtonW:32, Padding:(10,6,8,6), Radius:6, Density:32Yes
VisualDisplay = 10Visual-forward display (icon/swatch-first) for selected values with leading image support.VisualDisplayComboBoxPainterButtonW:32, Padding:(10,6,8,6), Radius:8, Separator:YesNo

ControlStyle Mapping

When ComboBoxType has not been explicitly set, setting ControlStyle on the control automatically maps to a default ComboBoxType: Material* → FilledSoft, iOS15/Apple/PillRail → RoundedPill, Fluent*/Windows11Mica/Shadcn/RadixUI/NextJS/Linear → OutlineDefault, Minimal/NotionMinimal/VercelClean → MinimalBorderless, NeoBrutalist/Brutalist → SegmentedTrigger, Bootstrap/AntDesign/ChakraUI → OutlineSearchable.

Supporting Enums

BeepAutoCompleteMode

ValueDescription
NoneNo auto-complete suggestions.
PrefixMatches items starting with the typed text (default).
FuzzyFuzzy subsequence matching: all typed characters must appear in order in the item text.
FullContains/substring match anywhere in the item text.

BeepComboBoxValidationState

ValueDescription
NoneNo validation state (default).
ErrorShows red border, error-coloured status icon (AlertCircle), red-tinted background.
WarningShows orange border, warning icon (AlertTriangle), orange-tinted background.
SuccessShows green border, success check icon (Check), green-tinted background.

BeepComboBoxSize

ValueLogical HeightUse Case
Small24 pxCompact toolbars, dense forms.
Medium32 pxDefault form controls (default).
Large40 pxProminent inputs, touch-friendly UIs.

Properties

Data & Selection

PropertyTypeDefaultCategoryDescription
ListItemsBindingList<SimpleItem>Empty listDataThe collection of items in the dropdown. Supports DesignerSerializationVisibility.Content.
SelectedItemSimpleItemnullDataThe currently selected item. Setting resets error state if a valid non-empty item is selected. Fires SelectedItemChanged and SelectedIndexChanged.
SelectedTextstring""DataRead-only. Returns the text of SelectedItem or the free-typed input text.
SelectedValueobjectnullDataSetter accepts SimpleItem or arbitrary values resolved via ResolveItemFromValue. Getter returns item.Value ?? item.Item ?? item.Text.
SelectedIndexint-1DataIndex of the selected item. Setting out-of-range clears selection.
CategoryDbFieldCategoryStringBehaviorDatabase field category for data binding.

Appearance

PropertyTypeDefaultDescription
ComboBoxTypeComboBoxTypeOutlineDefaultVisual variant. Changing swaps the painter, re-applies layout tokens, and may auto-enable multi-select/search.
ControlStyleBeepControlStyleInheritedMaps to ComboBoxType unless type was explicitly set.
TextFontFontSystem defaultFont for display text. Setting disables theme font. Resolved via BeepThemesManager.ToFont when UseThemeFont = true.
PlaceholderTextstring"Select an item..."Placeholder shown when no item is selected and no text has been typed.
DropdownIconPathstring""Custom path to dropdown icon. Default uses SvgsUI.ChevronDown SVG with animated rotation.
ShowStatusIconsboolfalseWhen true, renders the ImagePath icon for each popup row.
ShowOptionDescriptionbooltrueWhen true, renders each item's SubText as a second line below the label.

Behavior

PropertyTypeDefaultDescription
IsEditableboolfalseAllows text editing via the inline editor.
ShowSearchInDropdownboolfalseForces the search box to appear in the dropdown regardless of type. Auto-enabled for searchable types.
AutoCompletebooltrueEnables auto-complete as the user types.
AutoCompleteModeBeepAutoCompleteModePrefixMatching strategy: None, Prefix, Fuzzy, or Full.
AutoCompleteMinLengthint1Minimum input length before triggering auto-complete.
MaxSuggestionsint10Maximum number of auto-complete suggestions.
AutoCompleteDelayint0Debounce delay in milliseconds before triggering auto-complete.
AnimationDurationint200Duration of animations in milliseconds.
EnableAnimationsbooltrueWhether animations are enabled.
AnimateChevronbooltrueAnimates chevron rotation (0° closed → 180° open) at ~60 FPS via a 16 ms timer.
ReduceMotionboolfalseSkips all timer-driven animations (chevron, spinner, chip) and snaps to final state.
IsLoadingboolfalseShows a rotating spinner in the dropdown button area and a translucent haze over text. Disables interaction.
ShowSkeletonboolfalseRenders an animated shimmer stripe over the text area. Sweeps left-to-right at ~42 FPS.
ShowClearButtonboolfalseShows a × button when a value is selected. Clicking clears selection.
ValidationStateBeepComboBoxValidationStateNoneDrives border colour, status icon, and background tint.
EmptyStateTextstring"No options"Text shown when the dropdown list is empty or all items are filtered out.
AutoFlipbooltrueWhen true, the dropdown opens upward if insufficient space below.

Multi-Select

PropertyTypeDefaultDescription
AllowMultipleSelectionboolfalseEnables multi-select mode. Auto-enabled for MultiChipCompact and MultiChipSearch types.
SelectedItemsList<SimpleItem>Empty listThe collection of currently selected items. Setting triggers chip add/remove animations. SelectedItem syncs to first selected item.
MaxDisplayChipsint3Number of chips to show before collapsing into a +N overflow badge.
ChipAnimationDurationint200Duration of chip add/remove animations in ms. Animated at ~60 FPS.
ShowSelectAllbooltruePins a "Select all / Clear all" row at the top of the dropdown in multi-select mode.
UseApplyCancelFooterboolfalseSelection changes stay pending until Apply; Cancel restores snapshot.
UsePrimaryActionFooterboolfalseShows a single configurable CTA footer button instead of Apply/Cancel.
PrimaryActionFooterTextstring"Select {count} item(s)"Primary CTA footer text. {count} is replaced with selected count.
AllowFreeTextboolfalseWhen enabled in multi-select, typing a delimiter converts the current token into a chip.
TokenDelimiterschar[]',', ';'Characters that trigger free-text tokenization.

Layout

PropertyTypeDefaultDescription
DropdownButtonWidthint32Width of the dropdown button in pixels. ≤0 resets to painter default.
InnerPaddingPaddingPainter defaultPadding inside the combo box. Padding.Empty resets to painter default.
SizeVariantBeepComboBoxSizeMediumPredefined height: Small (24 px), Medium (32 px), Large (40 px).
MinDropdownWidthint0Minimum width of the dropdown. 0 means the popup matches control width.
DropDownRowsint8Maximum visible items in the dropdown. Determines popup height.
AutoSizeDropDownbooltrueAutomatically sizes dropdown width to fit the widest item.
DropDownWidthint0Explicit dropdown width. 0 means auto-size.
DropdownListBoxTypeListBoxType?nullListBoxType for dropdown popup. Null means auto-mapped from ComboBoxType via ComboBoxListBoxTypeMapper.
MaxDropdownHeightint200Maximum height of the dropdown list in pixels.
IsRtlboolfalseMirrors the layout: dropdown button on the left, text right-aligned, chips flow right-to-left. Uses Graphics.ScaleTransform(-1, 1).

Accessibility

PropertyTypeDefaultDescription
AccessibleNamestring"Combo box"Name for screen readers.
AccessibleDescriptionstring"Select an item from the dropdown list"Description for screen readers.

Methods

Value Access

MethodSignatureDescription
SetValuevoid SetValue(object value)Sets the selected value. Wraps SelectedValue.
GetValueobject GetValue()Gets the selected value. Returns SelectedValue.
ClearSelectionvoid ClearSelection()Clears selection, input text, and display text.
Clearvoid Clear()Clears selection by setting SelectedItem = null.
Resetvoid Reset()Clears selection, input text, error state, and error text.

Dropdown Management

MethodSignatureDescription
ShowDropdownvoid ShowDropdown()Opens the dropdown popup. Creates a fresh BeepContextMenu each time. Fires PopupOpened.
CloseDropdownvoid CloseDropdown()Closes the dropdown popup. Fires PopupClosed.
ToggleDropdownvoid ToggleDropdown()Toggles the dropdown open/closed state.
ShowPopupvoid ShowPopup()Legacy alias for ShowDropdown.
ClosePopupvoid ClosePopup()Legacy alias for CloseDropdown.
TogglePopupvoid TogglePopup()Legacy alias for ToggleDropdown.

Editing

MethodSignatureDescription
ShowInlineEditorvoid ShowInlineEditor()Shows the inline BeepTextBox over the text area. Only allowed when editable, free-text, or type supports inline editing.
HideInlineEditorvoid HideInlineEditor(bool commitText)Hides the inline editor. If true, matches typed text against the list or keeps it as free text.
StartEditingvoid StartEditing()Delegates to ShowInlineEditor.
StopEditingvoid StopEditing()Delegates to HideInlineEditor(true).

Selection Helpers

MethodSignatureDescription
SelectItemByTextvoid SelectItemByText(string text)Selects the first item matching by Text (case-insensitive).
SelectItemByValuevoid SelectItemByValue(object value)Selects by value. Uses ResolveItemFromValue for matching.
DeselectItemvoid DeselectItem(SimpleItem item)Removes a specific item from the multi-select set. No-op if not selected.

Layout & Rendering

MethodSignatureDescription
GetTextAreaRectRectangle GetTextAreaRect()Returns the calculated text area rectangle.
GetDropdownButtonRectRectangle GetDropdownButtonRect()Returns the calculated dropdown button rectangle.
GetImageRectRectangle GetImageRect()Returns the calculated leading image rectangle.
Drawvoid Draw(Graphics g, Rectangle rect)Statically paints the combo box into an arbitrary rectangle. Used by grid and container controls. Uses same layout/painter as DrawContent.
ApplyThemeoverride void ApplyTheme()Applies combo-box-specific theme colours and resolves theme font.

Events

EventDelegateRaised When
SelectedItemChangedEventHandler<SelectedItemChangedEventArgs>The selected item changes (single-select). Fires RaiseSubmitChanges().
SelectedIndexChangedEventHandler<SelectedItemChangedEventArgs>Raised simultaneously with SelectedItemChanged for backwards compatibility.
SelectedItemsChangedEventHandlerThe multi-select selection set changes. Fires when items are toggled in the popup.
PopupOpenedEventHandlerFires at the end of ShowDropdown after the context menu is displayed.
PopupClosedEventHandlerFires when the dropdown menu closes (via CloseDropdown, MenuClosed, or focus loss).

The SelectedItemChangedEventArgs carries the newly selected SimpleItem.

Inline Editor & Search

Inline Editor Lifecycle

The inline editor is a BeepTextBox child control (frameless, no shadow, ControlStyle.None) created lazily on first use. It overlays _textAreaRect when the user clicks the text area in an editable or searchable combo box.

  • Creation: Theme and font applied once at creation — never on every show.
  • Show: ShowInlineEditor() positions the editor over _textAreaRect, pre-fills with current display text, suppresses live-search during programmatic text assignment.
  • Live Search: InlineEditor_TextChanged syncs _inputText and opens the dropdown if not already open.
  • Free-Text Tokenization: When AllowFreeText + AllowMultipleSelection are enabled, typing , or ; creates a chip from the typed token and clears input.
  • Key Handling: Enter commits, Escape discards, Down commits and shows dropdown.
  • Commit: HideInlineEditor(true) matches typed text via FindItemByText. If found, selects the match; otherwise keeps free text.

Auto-Complete Engine

  • Prefix: StartsWith(StringComparison.OrdinalIgnoreCase)
  • Fuzzy: All typed characters must appear in order in the item text (character walk).
  • Full: Contains(StringComparison.OrdinalIgnoreCase)

Configurable debounce via AutoCompleteDelay. Results capped at MaxSuggestions.

Search Engine (Popup)

ComboBoxSearchEngine.FilterRows provides scored search:

  • Prefix: baseWeight + 300 - lengthDiff
  • Substring: baseWeight + 200 - startIndex
  • Fuzzy: baseWeight + 100 - spread

Group headers are kept only when at least one child item matches. Best match tracked for keyboard focus.

Multi-Select Mode

Enabling

Set AllowMultipleSelection = true or use ComboBoxType.MultiChipCompact / MultiChipSearch. The popup switches to checkbox rows; selected items render as chip tokens.

Chip Layout Engine

ComboBoxChipLayoutEngine computes chip positions left-to-right, wrapping to a second row if needed (up to 2 rows). Each chip has body, text, and close button (16px ×) rectangles. Exceeding space produces a +N overflow badge.

Chip Rendering

ComboBoxChipPainter draws rounded-rect chips using theme tokens (SelectedBackColor, SelectedForeColor, SelectedBorderColor). Disabled chips use muted colours. Contrast ratio checked (2.5:1 minimum). Overflow badge shows +N text centered. Close buttons render SVG X at 75% opacity.

Hit-test rects for chip bodies and close buttons are registered in ChipCloseRects and ChipBodyRects dictionaries, keyed by item identity. Chip body click opens popup and can scroll to item.

Chip Animation

When SelectedItems is set, the setter diffs old/new lists and starts animations for added/removed chips. A 16 ms (~60 FPS) timer drives linear progress 0→1 (add) or 1→0 (remove) over ChipAnimationDuration.

Popup Selection Flow

  • Immediate: Checkbox toggle updates SelectedItems via deferred BeginInvoke. Popup stays open.
  • Apply/Cancel: Pending list; Apply commits, Cancel restores snapshot.
  • Primary Action: Single CTA button with {count} placeholder.
  • Select All: Virtual _selectall row toggles all/none.

Validation & Skeleton Loading

Validation States

ValidationState controls:

  • Border: Resolved from ErrorBorderColor, WarningBorderColor, SuccessBorderColor.
  • Background tint: 20-alpha overlay over the text area.
  • Status icon: Trailing SVG: AlertCircle (error), AlertTriangle (warning), Check (success).
  • Text colour: Error state uses ComboBoxErrorForeColor.

Loading Spinner

When IsLoading = true: translucent haze covers the text area (90-alpha of ComboBoxBackColor). Rotating CircleArrowRight SVG animates in the dropdown button area at 20 FPS (15°/tick, 50 ms). All mouse interaction disabled.

Skeleton Shimmer

When ShowSkeleton = true: all normal content replaced by shimmer. Base gray fill with an animated highlight band sweeping left-to-right using a triangular-blend LinearGradientBrush. Sweep advances at ~42 FPS (24 ms interval, SkeletonOffset 0→1). Clipped to text area.

Theming & Visual Tokens

Theme Token Resolution

ComboBoxStateFactory.Build resolves 40+ colour and font tokens into a ComboBoxThemeTokens snapshot once per paint frame:

GroupTokens
Field ShellBackColor, ForeColor, BorderColor, HoverBorderColor, FocusBorderColor, OpenBorderColor
DisabledDisabledBackColor, DisabledForeColor
ValidationErrorBorderColor, WarningBorderColor, SuccessBorderColor, ErrorForeColor
AffordancesPlaceholderColor, ChevronColor, ClearButtonColor, SelectionHighlight, ButtonHoverBackground
Chip/SelectedSelectedBackColor, SelectedForeColor, SelectedBorderColor
Popup SurfacePopupBackColor, PopupBorderColor, PopupRowBack/Hover/Selected/FocusColor, PopupGroupHeaderBack/Fore, PopupMutedForeColor, PopupSeparatorColor, PopupSubTextColor
TypographyLabelFont (from LabelFont theme), SubTextFont (from ComboBoxListFont theme)

A Fallback() method provides sensible Material-style defaults when no theme is active.

Visual Token Catalog

ComboBoxVisualTokenCatalog.Resolve returns layout geometry per type:

TokenTypeRangePurpose
ButtonWidthint22–40 pxPreferred dropdown button width.
InnerPaddingPaddingvariesDefault padding between border and content.
CornerRadiusint4–18 pxBorder corner radius.
TextInsetint6–10 pxHorizontal text inset within text area.
RowDensityint30–36 pxPopup row height.
ChipHeightint22–24 pxChip token height.
ShowButtonSeparatorbool—Vertical separator line between text and button.
UseSegmentedTriggerbool—Filled, distinct chevron segment.
IsFilledbool—Filled/tinted text area background.

ApplyTheme Override

Copies ComboBoxBackColor/ForeColor/BorderColor, hover/selected state colours, syncs inline editor colours from TextBoxBackColor/ForeColor, resolves TextFont via BeepThemesManager.ToFont(ComboBoxItemFont) when UseThemeFont = true. Batched via InvalidateOnce().

Architecture

The BeepComboBox follows a layered architecture with strict separation of concerns:

Partial Class Breakdown

FileLinesContents
BeepComboBox.cs57Class declaration, attributes (ToolboxItem, DisplayName, Category, Description), accessibility object (BeepComboBoxAccessibleObject).
BeepComboBox.Core.cs743Private fields, constructor, layout management, DPI scaling (OnDpiScaleChanged), loading/skeleton timers, chip animation helpers, Dispose.
BeepComboBox.Properties.cs795All public properties with [Browsable]/[Category]/[Description]/[DefaultValue] attributes.
BeepComboBox.Events.cs540Mouse events, keyboard events (OnKeyDown/KeyPress, ProcessDialogKey), auto-complete logic, fuzzy matching.
BeepComboBox.Methods.cs912Public methods (dropdown, inline editor, selection helpers), ApplyTheme, value resolution, popup selection queue, chevron animation trigger, fuzzy search scoring.
BeepComboBox.Drawing.cs240DrawContent and Draw overrides, painter factory, hit area registration, loading spinner drawing.

Render Pipeline (per frame)

  1. DrawContent(g) calls base.DrawContent(g) (border + background via BaseControl).
  2. ComboBoxStateFactory.Build(this) snapshots all live state into an immutable ComboBoxRenderState.
  3. ComboBoxLayoutEngine.Compute(DrawingRect, renderState, this) calculates sub-rectangles (text area, dropdown button, clear button, image, chips).
  4. If IsRtl, all rectangles are mirrored horizontally.
  5. The painter is lazily created via ComboBoxTypeRegistry.CreatePainter.
  6. _comboBoxPainter.Paint(g, this, state, layout) renders chips → text → decorations → clear button → validation icon → dropdown button → spinner/skeleton.
  7. RegisterHitAreas() registers interactive zones for mouse hover/cursor changes.

Painter Hierarchy

IComboBoxPainter
 ├─ ComboBoxFieldPainterBase           (background, text, icons, spinner, skeleton, RTL)
    ├─ DesignSystemComboBoxFieldPainterBase (filled, segmented, borderless, search-icon)
       ├─ OutlineDefaultComboBoxPainter     ─ FilledSoftComboBoxPainter
       ├─ RoundedPillComboBoxPainter         ─ SegmentedTriggerComboBoxPainter
       ├─ MultiChipCompactComboBoxPainter    ─ MultiChipSearchComboBoxPainter
       ├─ DenseListComboBoxPainter           ─ MinimalBorderlessComboBoxPainter
       ├─ CommandMenuComboBoxPainter         ─ VisualDisplayComboBoxPainter
       ├─ OutlineSearchableComboBoxPainter

Helper Classes

ClassLocationPurpose
BeepComboBoxHelperHelpers/Text measurement, display text resolution, placeholder detection, item lookup, colour computation.
ComboBoxTypeRegistryHelpers/Maps ComboBoxType to painter class (factory pattern).
ComboBoxStateFactoryHelpers/Builds immutable ComboBoxRenderState and ComboBoxThemeTokens snapshots.
ComboBoxLayoutEngineHelpers/Stateless layout calculator producing ComboBoxLayoutSnapshot.
ComboBoxChipLayoutEngineHelpers/Computes chip positions, wrapping, and overflow badges for multi-select.
ComboBoxSearchEngineHelpers/Prefix + substring + fuzzy search across popup rows with scoring.
ComboBoxPopupModelBuilderHelpers/Converts SimpleItem lists into normalized ComboBoxPopupRowModel with group headers, separators, and state flags.
ComboBoxListBoxTypeMapperHelpers/Maps ComboBoxType to ListBoxType for popup rendering.

Code Examples

Basic Dropdown

var combo = new BeepComboBox
{
    Location = new Point(12, 12),
    Size = new Size(240, 32),
    ComboBoxType = ComboBoxType.OutlineDefault,
    PlaceholderText = "Select a category..."
};

combo.ListItems.Add(new SimpleItem { Text = "Electronics", Name = "Elec" });
combo.ListItems.Add(new SimpleItem { Text = "Books", Name = "Books" });
combo.ListItems.Add(new SimpleItem { Text = "Clothing", Name = "Cloth" });

combo.SelectedItemChanged += (s, e) =>
{
    Console.WriteLine($"Selected: {combo.SelectedItem.Text}");
};

this.Controls.Add(combo);

Multi-Select with Chips

var multiCombo = new BeepComboBox
{
    ComboBoxType = ComboBoxType.MultiChipSearch,
    MaxDisplayChips = 2,
    ChipAnimationDuration = 150,
    ShowSelectAll = true,
    PlaceholderText = "Choose tags..."
};

multiCombo.ListItems.Add(new SimpleItem { Text = "UI/UX", GuidId = "tag1" });
multiCombo.ListItems.Add(new SimpleItem { Text = "Backend", GuidId = "tag2" });
multiCombo.ListItems.Add(new SimpleItem { Text = "DevOps", GuidId = "tag3" });
multiCombo.ListItems.Add(new SimpleItem { Text = "Data Science", GuidId = "tag4" });
multiCombo.ListItems.Add(new SimpleItem { Text = "Security", GuidId = "tag5" });

multiCombo.SelectedItemsChanged += (s, e) =>
{
    Console.WriteLine($"Selected {multiCombo.SelectedItems.Count} tag(s)");
};

Searchable with Auto-Complete

var searchCombo = new BeepComboBox
{
    ComboBoxType = ComboBoxType.OutlineSearchable,
    IsEditable = true,
    AutoComplete = true,
    AutoCompleteMode = BeepAutoCompleteMode.Fuzzy,
    AutoCompleteDelay = 300,
    MaxSuggestions = 8,
    ShowClearButton = true
};

Command Palette Style

var cmdCombo = new BeepComboBox
{
    ComboBoxType = ComboBoxType.CommandMenu,
    IsEditable = true
};

cmdCombo.ListItems.Add(new SimpleItem
{
    Text = "New File",
    SubText = "Create a new document",
    ShortcutText = "Ctrl+N"
});
cmdCombo.ListItems.Add(new SimpleItem
{
    Text = "Open Folder",
    SubText = "Browse and open a directory",
    ShortcutText = "Ctrl+O"
});

Validation & Loading

combo.IsLoading = true;

// After data arrives
combo.ListItems = new BindingList<SimpleItem>(fetchedItems);
combo.IsLoading = false;

if (!combo.SelectedItem?.IsEnabled == true)
{
    combo.ValidationState = BeepComboBoxValidationState.Error;
}

RTL Support

var rtlCombo = new BeepComboBox
{
    IsRtl = true,
    ComboBoxType = ComboBoxType.RoundedPill,
    PlaceholderText = "اختر عنصرًا..."
};
rtlCombo.ListItems.Add(new SimpleItem { Text = "الخيار الأول" });
rtlCombo.ListItems.Add(new SimpleItem { Text = "الخيار الثاني" });