RibbonOfficeMenu.Items 属性

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

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

语法

声明
<BrowsableAttribute(False)> _
ReadOnly Property Items As IList(Of RibbonControl)
    Get
[BrowsableAttribute(false)]
IList<RibbonControl> Items { get; }

属性值

类型:System.Collections.Generic.IList<RibbonControl>
您在设计时或运行时添加到 Microsoft Office 菜单的功能区控件的集合。

异常

异常 条件
InvalidOperationException

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

备注

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

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

.NET Framework 安全性

请参见

参考

RibbonOfficeMenu 接口

Microsoft.Office.Tools.Ribbon 命名空间

其他资源

如何:自定义 Microsoft Office 菜单

功能区对象模型概述