ComboBoxExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the ComboBox class.
- C#
- VB.NET
public class ComboBoxExtensions
Public Class ComboBoxExtensions
Methods
AutoCompleteMode<TComboBox>(comboBox, autoCompleteMode)
Sets the AutoCompleteMode property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the AutoCompleteMode property. |
| autoCompleteMode | AutoCompleteMode | The AutoCompleteMode to set for the combo box. |
Returns: TComboBox. The modified combo box with the updated AutoCompleteMode property.
This method allows you to specify the auto-complete mode for the combo box.
myComboBox.AutoCompleteMode(AutoCompleteMode.SuggestAppend);
CharacterCasing<TComboBox>(comboBox, casing)
Sets the CharacterCasing property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the CharacterCasing property. |
| casing | CharacterCasing | The CharacterCasing to set for the combo box. |
Returns: TComboBox. The modified combo box with the updated CharacterCasing property.
This method allows you to specify the character casing for the text in the combo box.
myComboBox.CharacterCasing(CharacterCasing.Upper);
DropDownHeight<TComboBox>(comboBox, height)
Sets the DropDownHeight property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the DropDownHeight property. |
| height | Int32 | The height of the drop-down portion of the combo box. |
Returns: TComboBox. The modified combo box with the updated DropDownHeight property.
This method allows you to specify the height of the drop-down portion of the combo box.
myComboBox.DropDownHeight(200);
DropDownStyle<TComboBox>(comboBox, style)
Sets the DropDownStyle property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the DropDownStyle property. |
| style | ComboBoxStyle | The ComboBoxStyle to set for the combo box. |
Returns: TComboBox. The modified combo box with the updated DropDownStyle property.
This method allows you to specify the drop-down style for the combo box.
myComboBox.DropDownStyle(ComboBoxStyle.DropDownList);
DropDownWidth<TComboBox>(comboBox, width)
Sets the DropDownWidth property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the DropDownWidth property. |
| width | Int32 | The width of the drop-down portion of the combo box. |
Returns: TComboBox. The modified combo box with the updated DropDownWidth property.
This method allows you to specify the width of the drop-down portion of the combo box.
myComboBox.DropDownWidth(150);
DroppedDown<TComboBox>(comboBox, value)
Sets the DroppedDown property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the DroppedDown property. |
| value | Boolean | A boolean indicating whether the combo box is dropped down. |
Returns: TComboBox. The modified combo box with the updated DroppedDown property.
This method allows you to programmatically open or close the drop-down portion of the combo box.
myComboBox.DroppedDown(true);
IncrementalSelection<TComboBox>(comboBox, value)
Sets the IncrementalSelection property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the IncrementalSelection property. |
| value | Boolean | A boolean indicating whether incremental selection is enabled. |
Returns: TComboBox. The modified combo box with the updated IncrementalSelection property.
This method allows you to enable or disable incremental selection for the combo box.
myComboBox.IncrementalSelection(true);
ItemHeight<TComboBox>(comboBox, height)
Sets the ItemHeight property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the ItemHeight property. |
| height | Int32 | The height of each item in the combo box. |
Returns: TComboBox. The modified combo box with the updated ItemHeight property.
This method allows you to specify the height of each item in the combo box.
myComboBox.ItemHeight(20);
Items<TComboBox>(comboBox, items)
Adds the specified items to the Items collection of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to which the items should be added. |
| items | ComponentTool[] | An array of items to add to the combo box. |
Returns: TComboBox. The modified combo box with the added items.
This method allows you to add multiple items to the combo box in one call.
myComboBox.Items("Item1", "Item2", "Item3");
LazyLoading<TComboBox>(comboBox, value)
Sets the LazyLoading property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the LazyLoading property. |
| value | Boolean | A boolean indicating whether lazy loading is enabled. |
Returns: TComboBox. The modified combo box with the updated LazyLoading property.
This method allows you to enable or disable lazy loading for the combo box.
myComboBox.LazyLoading(true);
MaxLength<TComboBox>(comboBox, length)
Sets the MaxLength property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the MaxLength property. |
| length | Int32 | The maximum number of characters that can be entered in the combo box. |
Returns: TComboBox. The modified combo box with the updated MaxLength property.
This method allows you to specify the maximum number of characters that can be entered in the combo box.
myComboBox.MaxLength(50);
OnAutoComplete<TComboBox>(comboBox, action)
Attaches an event handler for the AutoComplete event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox, HandledEventArgs> | An action to execute during the AutoComplete event, with the combo box and event arguments as parameters. |
Returns: TComboBox. The modified combo box with the attached AutoComplete event handler.
This method allows you to define custom auto-complete behavior by executing a specified action during the AutoComplete event.
myComboBox.OnAutoComplete((cb, args) =>
{
// Custom auto-complete logic
});
OnDropDownClosed<TComboBox>(comboBox, action)
Attaches an event handler for the DropDownClosed event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox> | An action to execute when the drop-down portion of the combo box is closed. |
Returns: TComboBox. The modified combo box with the attached DropDownClosed event handler.
This method allows you to execute a custom action whenever the drop-down portion of the combo box is closed.
myComboBox.OnDropDownClosed(cb =>
{
AlertBox.Show("Drop-down closed!");
});
OnDropDownStyleChanged<TComboBox>(comboBox, action)
Attaches an event handler for the DropDownStyleChanged event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox> | An action to execute when the DropDownStyle property changes. |
Returns: TComboBox. The modified combo box with the attached DropDownStyleChanged event handler.
This method allows you to execute a custom action whenever the DropDownStyle property of the combo box changes.
myComboBox.OnDropDownStyleChanged(cb =>
{
AlertBox.Show("Drop-down style changed!");
});
OnLoad<TComboBox>(comboBox, action)
Attaches an event handler for the Load event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox> | An action to execute when the combo box is loaded. |
Returns: TComboBox. The modified combo box with the attached Load event handler.
This method allows you to execute a custom action whenever the combo box is loaded.
myComboBox.OnLoad(cb =>
{
AlertBox.Show("Combo box loaded!");
});
OnSelectedIndexChanged<TComboBox>(comboBox, action)
Attaches an event handler for the SelectedIndexChanged event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox> | An action to execute when the SelectedIndex property changes. |
Returns: TComboBox. The modified combo box with the attached SelectedIndexChanged event handler.
This method allows you to execute a custom action whenever the SelectedIndex property of the combo box changes.
myComboBox.OnSelectedIndexChanged(cb =>
{
AlertBox.Show("Selected index changed!");
});
OnSelectedItemChanged<TComboBox>(comboBox, action)
Attaches an event handler for the SelectedItemChanged event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox> | An action to execute when the SelectedItem property changes. |
Returns: TComboBox. The modified combo box with the attached SelectedItemChanged event handler.
This method allows you to execute a custom action whenever the SelectedItem property of the combo box changes.
myComboBox.OnSelectedItemChanged(cb =>
{
AlertBox.Show("Selected item changed!");
});
OnSelectionChangeCommitted<TComboBox>(comboBox, action)
Attaches an event handler for the SelectionChangeCommitted event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox> | An action to execute when the selection change is committed by the user. |
Returns: TComboBox. The modified combo box with the attached SelectionChangeCommitted event handler.
This method allows you to execute a custom action whenever the user commits a selection change in the combo box.
myComboBox.OnSelectionChangeCommitted(cb =>
{
AlertBox.Show("Selection change committed!");
});
OnSortedChanged<TComboBox>(comboBox, action)
Attaches an event handler for the SortedChanged event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox> | An action to execute when the Sorted property changes. |
Returns: TComboBox. The modified combo box with the attached SortedChanged event handler.
This method allows you to execute a custom action whenever the Sorted property of the combo box changes.
myComboBox.OnSortedChanged(cb =>
{
AlertBox.Show("Sorted property changed!");
});
OnToolClick<TComboBox>(comboBox, action)
Attaches an event handler for the ToolClick event of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to attach the event handler to. |
| action | Action<TComboBox, ToolClickEventArgs> | An action to execute when a tool is clicked within the combo box. |
Returns: TComboBox. The modified combo box with the attached ToolClick event handler.
This method allows you to execute a custom action whenever a tool within the combo box is clicked.
myComboBox.OnToolClick((cb, e) =>
{
AlertBox.Show("Tool clicked!");
});
SelectedItem<TComboBox>(comboBox, item)
Sets the SelectedItem property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the SelectedItem property. |
| item | Object | The item to select in the combo box. |
Returns: TComboBox. The modified combo box with the updated SelectedItem property.
This method allows you to specify the selected item in the combo box.
myComboBox.SelectedItem("Item1");
SelectedText<TComboBox>(comboBox, text)
Sets the SelectedText property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the SelectedText property. |
| text | String | The text to select in the combo box. |
Returns: TComboBox. The modified combo box with the updated SelectedText property.
This method allows you to specify the selected text in the combo box.
myComboBox.SelectedText("SelectedText");
SelectionLength<TComboBox>(comboBox, length)
Sets the SelectionLength property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the SelectionLength property. |
| length | Int32 | The number of characters to select in the text of the combo box. |
Returns: TComboBox. The modified combo box with the updated SelectionLength property.
This method allows you to specify the number of characters to select in the text of the combo box.
myComboBox.SelectionLength(5);
SelectionStart<TComboBox>(comboBox, index)
Sets the SelectionStart property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the SelectionStart property. |
| index | Int32 | The starting position of the text selection in the combo box. |
Returns: TComboBox. The modified combo box with the updated SelectionStart property.
This method allows you to specify the starting position of the text selection in the combo box.
myComboBox.SelectionStart(2);
SelectOnEnter<TComboBox>(comboBox, value)
Sets the SelectOnEnter property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the SelectOnEnter property. |
| value | Boolean | A boolean indicating whether the text should be selected on enter. |
Returns: TComboBox. The modified combo box with the updated SelectOnEnter property.
This method allows you to enable or disable selecting the text when the combo box is entered.
myComboBox.SelectOnEnter(true);
Sorted<TComboBox>(comboBox, value)
Sets the Sorted property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the Sorted property. |
| value | Boolean | A boolean indicating whether the combo box is sorted. |
Returns: TComboBox. The modified combo box with the updated Sorted property.
This method allows you to specify whether the items in the combo box should be sorted automatically.
myComboBox.Sorted(true);
SpellCheck<TComboBox>(comboBox, value)
Sets the SpellCheck property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the SpellCheck property. |
| value | Boolean | A boolean indicating whether spell check is enabled. |
Returns: TComboBox. The modified combo box with the updated SpellCheck property.
This method allows you to enable or disable spell checking for the combo box.
myComboBox.SpellCheck(true);
Tools<TComboBox>(comboBox, tools)
Adds the specified tools to the Tools collection of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box to which the tools should be added. |
| tools | ComponentTool[] | An array of tools to add to the combo box. |
Returns: TComboBox. The modified combo box with the added tools.
This method allows you to add multiple tools to the combo box in one call.
myComboBox.Tools(tool1, tool2, tool3);
Watermark<TComboBox>(comboBox, text)
Sets the Watermark property of the specified ComboBox.
| Parameter | Type | Description |
|---|---|---|
| TComboBox | The type of the combo box, must inherit from ComboBox. | |
| comboBox | TComboBox | The combo box for which to set the Watermark property. |
| text | String | The watermark text to display in the combo box. |
Returns: TComboBox. The modified combo box with the updated Watermark property.
This method allows you to set a watermark text for the combo box.
myComboBox.Watermark("Enter text...");