RibbonOfficeMenu.Items 属性 (2007 system)

更新:2007 年 11 月

获取您添加到 Microsoft Office 菜单的功能区控件。

命名空间:  Microsoft.Office.Tools.Ribbon
程序集:  Microsoft.Office.Tools.Common.v9.0(在 Microsoft.Office.Tools.Common.v9.0.dll 中)

语法

声明
<BrowsableAttribute(False)> _
Public ReadOnly Property Items As RibbonComponentCollection(Of RibbonControl)
用法
Dim instance As RibbonOfficeMenu
Dim value As RibbonComponentCollection(Of RibbonControl)

value = instance.Items
[BrowsableAttribute(false)]
public RibbonComponentCollection<RibbonControl> Items { get; }

属性值

类型:Microsoft.Office.Tools.Ribbon.RibbonComponentCollection<RibbonControl>

您在设计时或运行时添加到 Microsoft Office 菜单的功能区控件的集合。

异常

异常 条件
InvalidOperationException

在加载功能区之后,尝试添加、移除或替换 RibbonControl

备注

可以在运行时添加控件,但只能在加载功能区之前添加。创建该控件的实例,然后将新控件添加到 Items 集合。有关更多信息,请参见功能区对象模型概述

在使用功能区设计器向 Microsoft Office 菜单添加控件时,Visual Studio Tools for Office 会自动将这些控件添加到 Items 属性。

权限

另请参见

参考

RibbonOfficeMenu 类

RibbonOfficeMenu 成员

Microsoft.Office.Tools.Ribbon 命名空间

其他资源

如何:自定义 Microsoft Office 菜单

功能区对象模型概述