Skip to content

Spinner

WinForms NumericUpDown can be missing from the tree

On some Windows 11 builds the WinForms NumericUpDown never shows up in the automation tree, even though the controls around it do. Focusing or clicking it doesn't help, because there is no element to find. Upstream FlaUI notes the same Windows/.NET bug (#74). WPF spinners work normally.

If you do find it, locate it by control type plus name: its automation id is not stable.

flaui.core.automation_elements.Spinner

Bases: AutomationElement

Class to interact with a WinForms spinner element

is_only_value property

Flag which indicates if the Slider supports range values (min->max) or only values (0-100). Only values are for example used when combining UIA3 and WinForms applications.

Returns:

Type Description
bool

True if only value else False

maximum property

The maximum value.

Returns:

Type Description
float

Maximum value

minimum property

The minimum value.

Returns:

Type Description
float

Minimum value

small_change property

The value of a small change.

Returns:

Type Description
float

Small change

value property writable

Gets the current value.

Returns:

Type Description
float

Value of the element

decrease_button()

The button element used to perform a large decrement.

Returns:

Type Description
Button

Button element

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def decrease_button(self) -> Button:
    """The button element used to perform a large decrement.

    :return: Button element
    """
    return Button(raw_element=self.raw_element.DecreaseButton())

decrement()

Performs a decrement.

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def decrement(self):
    """Performs a decrement."""
    self.raw_element.Decrement()

increase_button()

The button element used to perform a large increment.

Returns:

Type Description
Button

Button element

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def increase_button(self) -> Button:
    """The button element used to perform a large increment.

    :return: Button element
    """
    return Button(raw_element=self.raw_element.IncreaseButton())

increment()

Performs a increment.

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def increment(self):
    """Performs a increment."""
    self.raw_element.Increment()