Toggle Control Pattern

Describes guidelines and conventions for implementing IToggleProvider, including information about properties and methods. The Toggle control pattern is used to support controls that can cycle through a set of states and maintain a state once set.

For examples of controls that implement this control pattern, see Control Types and Their Supported Control Patterns.

This topic contains the following sections.

Implementation Guidelines and Conventions

When implementing the Toggle control pattern, note the following guidelines and conventions:

  • Controls that do not maintain state when activated, such as buttons, toolbar buttons, and hyperlinks, must implement IInvokeProvider instead.
  • A control must cycle through its toggle states (ToggleState) in the following order: ToggleState_On, ToggleState_Off and, if supported, ToggleState_Indeterminate.
  • Toggle does not provide a set-state method because of issues surrounding the direct setting of a three-state check box without cycling through its appropriate ToggleState sequence.
  • The radio button control does not implement IToggleProvider, because it is not capable of cycling through its valid states.

Required Members for IToggleProvider

The following properties and methods are required for implementing the IToggleProvider interface.

Required membersMember typeNotes
Toggle MethodNone
ToggleState PropertyNone


This control pattern has no associated events.

Related topics

Control Types and Their Supported Control Patterns
UI Automation Control Patterns Overview
UI Automation Tree Overview