Редагувати

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


SplitButton element

Represents a standard Split Button control.

Usage

<SplitButton
  ApplicationModes = "xs:string"
  CommandName = "xs:positiveInteger or xs:string">
  child elements
</SplitButton>

Attributes

Attribute Type Required Description
ApplicationModes
xs:string
No
Valid only if MenuGroup is the parent element.

(xs:string)
A string that contains a comma-separated list of integers between 0 and 31.
White space is valid and ignored.
Maximum length: 250 characters.
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

Element Description
Button
May occur one or more times

CheckBox
May occur one or more times

DropDownButton
May occur one or more times

DropDownColorPicker
May occur one or more times

DropDownGallery
May occur one or more times

SplitButton
May occur one or more times

SplitButton.ButtonItem
May occur at most once

SplitButton.MenuGroups
May occur at most once

SplitButtonGallery
May occur one or more times

ToggleButton
May occur one or more times

Parent elements

Element
ControlGroup
DropDownGallery
Group
MenuGroup
SplitButton
SplitButtonGallery

Remarks

Optional.

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

SplitButton supports application modes when it is hosted in the left column of the Application Menu.

DropDownGallery and SplitButtonGallery are not valid child elements of DropDownButton when DropDownButton is a descendant of ApplicationMenu.

SplitButton.MenuGroups must occur once if the following are not present as child elements of SplitButton:

These controls are treated as child elements of a single default SplitButton.MenuGroups element.

Examples

The following example demonstrates the basic markup for the Split Button.

This section of code shows the SplitButton Command declarations, with an associated Group that functions as the parent container for the SplitButton element.

<!-- SplitButton -->
<Command Name="cmdSplitButtonGroup"
         Symbol="cmdSplitButtonGroup"
         Comment="SplitButton Group"
         LabelTitle="SplitButton"/>
<Command Name="cmdSplitButton"
         Symbol="cmdSplitButton"
         Comment="SplitButton"
         LabelTitle="SplitButton"/>
<Command Name="cmdSBButtonItem"
         Symbol="cmdSBButtonItem"
         Comment="SBButtonItem"
         LabelTitle="SB ButtonItem"/>
<Command Name="cmdSBButton1"
         Symbol="cmdSBButton1"
         Comment="SBButton1"
         LabelTitle="SB Button">
  <Command.LargeImages>
    <Image Source="res/copyL_32.bmp"/>
  </Command.LargeImages>
  <Command.SmallImages>
    <Image Source="res/copyS_16.bmp"/>
  </Command.SmallImages>
  <Command.LargeHighContrastImages>
    <Image Source="res/copyLHC_32.bmp"/>
  </Command.LargeHighContrastImages>
  <Command.SmallHighContrastImages>
    <Image Source="res/copySHC_16.bmp"/>
  </Command.SmallHighContrastImages>
</Command>
<Command Name="cmdSBMajorItems"
         Comment="Major Items Category"
         LabelTitle="Major Items"/>
<Command Name="cmdSBStandardItems"
         Comment="Standard Items Category"
         LabelTitle="Standard Items"/>

This section of code shows the SplitButton control declarations.

<Group CommandName="cmdSplitButtonGroup">
  <SplitButton CommandName="cmdSplitButton">
    <SplitButton.ButtonItem>
      <Button CommandName="cmdSBButtonItem"/>
    </SplitButton.ButtonItem>
    <SplitButton.MenuGroups>
      <MenuGroup CommandName="cmdSBMajorItems" 
                 Class="MajorItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
      <MenuGroup CommandName="cmdSBStandardItems"
                 Class="StandardItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
      <MenuGroup Class="StandardItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
    </SplitButton.MenuGroups>
  </SplitButton>
</Group>

Element information

  • Minimum supported system: Windows 7
  • Can be empty: No

See also

Split Button control

SetModes