Редагувати

Поділитися через


ToggleButton element

Represents a Toggle Button control.

Usage

<ToggleButton
  CommandName = "xs:positiveInteger or xs:string"
  ApplicationDefaults.IsChecked = "Boolean"/>

Attributes

Attribute Type Required Description
ApplicationDefaults.IsChecked
Boolean
No
This attribute is valid only when the ToggleButton element is a child of QuickAccessToolbar.ApplicationDefaults.
Restricted to one of the following values:

(true)
Default.
(false)
CommandName
xs:positiveInteger or xs:string
No
Associates the element with a Command.

(xs:positiveInteger or xs:string)
A string, an integer value between 2 and 59999, inclusive, or a hexadecimal value between 0x2 and 0xea5f, inclusive.
The value must be unique within the Ribbon XML document.
Maximum length: 100 characters.

Child elements

There are no child elements.

Parent elements

Element
ControlGroup
DropDownButton
DropDownGallery
Group
MenuGroup
QuickAccessToolbar.ApplicationDefaults
SplitButton
SplitButton.ButtonItem
SplitButtonGallery

Remarks

Optional or required, depending on the parent element.

May occur at most once for each SplitButton.ButtonItem element.

May occur one or more times for each ControlGroup, DropDownButton, Group, DropDownGallery, MenuGroup, QuickAccessToolbar.ApplicationDefaults, SplitButton, or SplitButtonGallery element.

Examples

The following example demonstrates the basic markup for the ToggleButton element.

This section of code shows a ToggleButton element declaration within the QuickAccessToolbar.ApplicationDefaults element.

      <Ribbon.QuickAccessToolbar>
        <QuickAccessToolbar CommandName="cmdQAT"
                            CustomizeCommandName="cmdCustomizeQAT">
          <QuickAccessToolbar.ApplicationDefaults>
            <Button CommandName="cmdButton1"/>
            <ToggleButton CommandName="cmdMinimize"
                          ApplicationDefaults.IsChecked="false"/>
          </QuickAccessToolbar.ApplicationDefaults>
        </QuickAccessToolbar>
      </Ribbon.QuickAccessToolbar>

Element information

Requirement Details
Minimum supported system
Windows 7
Can be empty Yes

See also

Toggle Button control