CheckBox Element

Applies to: SharePoint Foundation 2010

Defines a check box control.

<CheckBox
     Alt="Text"
     Command="Text"
     Id="Text"
     LabelText="Text"
     MenuItemId="Text"
     QueryCommand="Text"
     Sequence="Integer"
     TemplateAlias="Text"
     ToolTipImage32by32="Url"
     ToolTipImage32by32Class="CSS Class Selector"
     ToolTipImage32by32Left="Negative Integer"
     ToolTipImage32by32Top="Negative Integer"
     ToolTipTitle="Text"
     ToolTipDescription="Text"
     ToolTipHelpKeyWord="Text"
     ToolTipShortcutKey="Text"
/>

Attributes

Attribute

Description

Alt

Optional. Alternative text that is used for the check box.

Command

Optional. The name of the command to execute when the control is clicked. If the control is in a CommandUIDefinition element, the value of the Command attribute of the control should be the same as the value of the Command attribute of a corresponding CommandUIHandler element.

Id

Required. Identifies the control. The value can be a string representation of a GUID or a unique term, such as "Ribbon.Library.Share.NewRibbonCheckBox".

LabelText

Optional. The text to label the control.

MenuItemId

Optional. A string that identifies the menu item where the button is located.

QueryCommand

Optional. The name of the command to execute when polling for state information.

Sequence

Optional. An integer that specifies the order of placement among sibling XML nodes.

TemplateAlias

Optional. A string that matches the value of the TemplateAlias attribute for a ControlRef element, an OverflowArea element, or an OverflowSection element in a GroupTemplate element. The TemplateAlias attribute is used to size and position controls within a group when a template is applied to the group.

ToolTipImage32by32

Optional. A server-relative URL to a file that contains a 32-by-32-pixel image to be used in the tooltip, such as "/_layouts/1033/images/formatmap32x32.png".

ToolTipImage32by32Class

Optional. The name of a CSS class selector to be applied to the tooltip image.

ToolTipImage32by32Left

Optional. A negative integer that represents an offset for the left edge of the image. Use this attribute when the ToolTipImage32by32 attribute points to an image file that contains images for many icons. The value of the ToolTipImage32by32Left attribute is used to set the CSS left attribute for the inline style of an HTML img tag.

ToolTipImage32by32Top

Optional. A negative integer that represents an offset for the top edge of the image. Use this attribute when the ToolTipImage32by32 attribute points to an image file that contains the images for many icons. The value of the ToolTipImage32by32Top attribute is used to set the CSS top attribute for the inline style of an HTML img tag.

ToolTipTitle

Optional. The text that appears as the title of the tooltip.

ToolTipDescription

Optional. The text that appears in the body of the tooltip.

ToolTipHelpKeyWord

Optional. The keyword that is used by context-sensitive Help.

ToolTipShortcutKey

Optional. The text to display for the shortcut key in the tooltip. For example, if the shortcut key for the control is ALT + J, the value for this attribute is "ALT + J". The tooltip will display the text for the shortcut key in parentheses after the tooltip title: "(ALT + J)".

Child Elements

None

Parent Elements

CommandUIDefinition

Controls (Group)

Occurrences

Minimum: 0

Maximum: unbounded

Example

The following example is an XML fragment that defines a group of controls that includes a CheckBox element.

<Group 
  Id="Ribbon.Image.Image.Size"
  Sequence="50"
  Command="ImageSizeGroup"
  Description=""
  Title="$Resources:core,GrpSize;"
  Image32by32Popup="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32PopupTop="-128" Image32by32PopupLeft="0"
  Template="Ribbon.Templates.Flexible2"
>
  <Controls Id="Ribbon.Image.Image.Size.Controls">
    <Label
      Id="Ribbon.Image.Image.Size.HorizontalSizeLabel"
      LabelText="$Resources:core,LabelHorizSize;"
      Command="ImageHorizontalLabel"
      ForId="Ribbon.Image.Image.Size.HorizontalSize"
      Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-80" Image16by16Left="-16"
      TemplateAlias="o1"
      Sequence="10" 
    />
    <Spinner
       Id="Ribbon.Image.Image.Size.HorizontalSize"
       DefaultUnit="pixel"
       DefaultValue="10"
       AltUpArrow="$Resources:core,cui_spnUpAlt;"
       AltDownArrow="$Resources:core,cui_spnDownAlt;"
       AccelerationInterval="125"
       MultiplierInterval="2000"
       ImeEnabled="false"
       Command="ImageWidth"
       QueryCommand="QueryImageWidth"
       ToolTipTitle="$Resources:core,LabelHorizSize;"
       ToolTipDescription="$Resources:core,cui_stt_ButSizeMenuHorizontalSizeTooltip;"
       TemplateAlias="o2"
      Sequence="20" 
    >
      <Unit
          Name="pixel"
          MinimumValue="1"
          MaximumValue="2000"
          DecimalDigits="0"
          Interval="5"
        >
        <UnitAbbreviation Value="px" />
      </Unit>
      <Unit
          Name="percent"
          MinimumValue="1"
          MaximumValue="100"
          DecimalDigits="0"
          Interval="1"
        >
        <UnitAbbreviation Value="%" />
      </Unit>
    </Spinner>
    <Label
      Id="Ribbon.Image.Image.Size.VertSizeLabel"
      LabelText="$Resources:core,LabelVertSize;"
      Command="ImageVerticalLabel"
      ForId="Ribbon.Image.Image.Size.VerticalSize" 
      Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-208" Image16by16Left="-224"
      TemplateAlias="o1"
      Sequence="30" 
    />
    <Spinner
      Id="Ribbon.Image.Image.Size.VerticalSize"
      DefaultUnit="pixel"
      DefaultValue="10"
      AltUpArrow="$Resources:core,cui_spnUpAlt;"
      AltDownArrow="$Resources:core,cui_spnDownAlt;"
      AccelerationInterval="125"
      MultiplierInterval="2000"
      Command="ImageHeight"
      ImeEnabled="false"
      QueryCommand="QueryImageHeight"
      ToolTipTitle="$Resources:core,LabelVertSize;"
      ToolTipDescription="$Resources:core,cui_stt_ButSizeMenuVerticalSizeTooltip;"
      TemplateAlias="o2"
      Sequence="40" 
    >
      <Unit
          Name="pixel"
          MinimumValue="1"
          MaximumValue="2000"
          DecimalDigits="0"
          Interval="5"
        >
        <UnitAbbreviation Value="px" />
      </Unit>
      <Unit
          Name="percent"
          MinimumValue="1"
          MaximumValue="100"
          DecimalDigits="0"
          Interval="1"
        >
        <UnitAbbreviation Value="%" />
      </Unit>
    </Spinner>
    <CheckBox
      Id="Ribbon.Image.Image.Size.LockAspect"
      Command="ImageLockRatio"
      QueryCommand="QueryImageLockRatio"
      LabelText="$Resources:core,LabelLockAspect;"
      Alt="$Resources:core,ButLockAspectAlt;"
      TemplateAlias="o2"
      Sequence="50" 
    />
  </Controls>
</Group>