Skip to content

ComboBox

flaui.core.automation_elements.ComboBox

Bases: AutomationElement

Class to interact with a combobox element

animation_duration property writable

Timespan to wait until the animation for opening/closing is finished.

Returns:

Type Description
Any

C# TimeSpan object from System namespace

editable_text property writable

The text of the editable element inside the combobox. Only works if the combobox is editable.

Returns:

Type Description
str

Editable text of the element

expand_collapse_state property

Gets the ExpandCollapseStateof the element

Returns:

Type Description
ExpandCollapseState

Expand/Collapse state

is_editable property

Flag which indicates, if the combobox is editable or not

Returns:

Type Description
bool

True If element editable, else False

is_read_only property

Flag which indicates, if the combobox is read-only or not

Returns:

Type Description
bool

True If element read-only, else False

items property

Gets all available items from the ComboBox element

Returns:

Type Description
List[ComboBoxItem]

Item

selected_item property

Gets the first selected item or null otherwise

Returns:

Type Description
ComboBoxItem

Selected item

selected_items property

Gets all selected items

Returns:

Type Description
List[str]

Selected items

value property

Selected value of the Combobox element

Returns:

Type Description
str

Element selected value

collapse()

Collapses the element

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def collapse(self) -> None:
    """Collapses the element"""
    self.raw_element.Collapse()

expand()

Expands the element

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def expand(self) -> None:
    """Expands the element"""
    self.raw_element.Expand()

select(value)

Select an item by index/the first item which matches the given text..

Parameters:

Name Type Description Default
value Union[int, str]

Index value/The text to search for

required

Returns:

Type Description
ComboBoxItem

The first found item or null if no item matches.

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def select(self, value: Union[int, str]) -> ComboBoxItem:
    """Select an item by index/the first item which matches the given text..

    :param value: Index value/The text to search for
    :return: The first found item or null if no item matches.
    """
    return ComboBoxItem(raw_element=self.raw_element.Select(value))