Skip to main content

ToggleMenuFlyoutItem

A menu item that turns an option on or off, showing a checkmark when it is on.

Example:

fluent.ToggleMenuFlyoutItem("Show status bar", value=True)

Inherits: Control

Properties

  • close_on_click - Whether clicking this item closes the menu.
  • content - The label of this item.
  • trailing - Text or a control shown at the end of this item, typically a keyboard shortcut.
  • value - Whether the option is on.

Events

  • on_change - Called when the user turns the option on or off.

Properties​

close_on_clickclass-attributeinstance-attribute​

close_on_click: bool = True

Whether clicking this item closes the menu.

contentinstance-attribute​

content: StrOrControl

The label of this item.

trailingclass-attributeinstance-attribute​

trailing: StrOrControl | None = None

Text or a control shown at the end of this item, typically a keyboard shortcut.

valueclass-attributeinstance-attribute​

value: bool = False

Whether the option is on.

Events​

on_changeclass-attributeinstance-attribute​

on_change: (
    ControlEventHandler[ToggleMenuFlyoutItem] | None
) = None

Called when the user turns the option on or off.

value holds the new state.