Group 元素(功能区)

上次修改时间: 2015年3月9日

适用范围: SharePoint Foundation 2010

本文内容
属性
子元素
父元素
出现次数

定义一组控件。

<Group
  Command="Text"
  Description="Text"
  Id="Text"
  Image32by32Popup="Url"
  Image32by32PopupClass="CSS Class Selector"
  Image32by32PopupLeft="Negative Integer"
  Image32by32PopupTop="Negative Integer"
  Sequence="Integer"
  Template="Text"
  Title="Text"
/>

属性

属性

说明

Command

可选。值用于启用或禁用组中的控件。如果 Command 属性存在并且具有值,则功能区将轮询以确定该命令是否已禁用。如果已禁用,则功能区不再轮询与组中的控件相关联的任何命令;还将有效禁用控件。

Description

可选。组的说明。

Id

必需。标识组的字符串,如"Ribbon.DocLibListForm.Edit.Clipboard"。

Image32by32Popup

可选。文件(包含用于表示组的 32×32 像素图像)的相对于服务器的 URL,如"/_layouts/1033/images/formatmap32x32.png"。

Image32by32PopupClass

可选。应用于图像的 CSS 类选择器的名称。

Image32by32PopupLeft

可选。一个负整数,表示图像左边缘的偏移。当 Image32by32Popup 属性指向的图像文件包含很多图标的图像时,使用此属性。Image32by32PopupLeft 属性的值用于设置 HTML img 标记的级联样式的 CSS left 属性。

Image32by32PopupTop

可选。一个负整数,表示图像上边缘的偏移。当 Image32by32Popup 属性指向的图像文件包含很多图标的图像时,使用此属性。Image32by32PopupTop 属性的值用于设置 HTML img 标记的级联样式的 CSS top 属性。

Sequence

可选。一个指定同级 XML 节点之间的放置顺序的整数。

Template

可选。一个与 GroupTemplate 元素的 Id 属性相对应的字符串。

Title

可选。在功能区和工具提示中显示为组标题的文本。

子元素

Controls

父元素

CommandUIDefinition

Groups

出现次数

最小值:0

最大值:无限制

示例

以下 XML 片段定义包含两个按钮的组。

<Group
  Id="Ribbon.WikiPageTab.CustomGroup"
  Sequence="55"
  Description="Custom Group"
  Title="Custom"
  Command="EnableCustomGroup"
  Template="Ribbon.Templates.Flexible2">
  <Controls Id="Ribbon.WikiPageTab.CustomGroup.Controls">
    <Button
      Id="Ribbon.WikiPageTab.CustomGroup.CustomGroupHello"
      Command="CustomGroupHelloWorld"
      Image16by16="/_layouts/images/FILMSTRP.GIF"
      Image32by32="/_layouts/images/PPEOPLE.GIF"
      LabelText="Hello, World"
      TemplateAlias="o2"
      Sequence="15" />
    <Button
      Id="Ribbon.WikiPageTab.CustomGroup.CustomGroupGoodbye"
      Command="CustomGroupGoodbyeWorld"
      Image16by16="/_layouts/images/FILMSTRP.GIF"
      Image32by32="/_layouts/images/PPEOPLE.GIF"
      LabelText="Good-bye, World"
      TemplateAlias="o2"
      Sequence="18" />
  </Controls>
</Group>

请参阅

任务

演练:向服务器功能区中添加组