本文為機器翻譯文章。如需檢視英文版,請選取 [原文] 核取方塊。您也可以將滑鼠指標移到文字上,即可在快顯視窗顯示英文原文。
譯文
原文

RibbonMenu.Items 屬性

 

取得功能表上的控制項集合。

命名空間:   Microsoft.Office.Tools.Ribbon
組件:  Microsoft.Office.Tools.Common (於 Microsoft.Office.Tools.Common.dll)

IList<RibbonControl> Items { get; }

屬性值

Type: System.Collections.Generic.IList<RibbonControl>

功能表上的控制項集合。

Exception Condition
InvalidOperationException

您嘗試在載入功能區之後新增、移除或取代 RibbonControl 至這個集合。

To add a Ribbon control to a menu at run time, create an instance of the control, and then add the new control to the P:Microsoft.Office.Tools.Ribbon.RibbonMenu.Items collection. If you want to do this after the Ribbon is loaded into the Office application, you must set the P:Microsoft.Office.Tools.Ribbon.RibbonMenu.Dynamic property to true. For more information, see Ribbon Object Model Overview.

When you add controls to a menu by using the Ribbon Designer, Visual Studio automatically adds the controls to the P:Microsoft.Office.Tools.Ribbon.RibbonMenu.Items property of the menu.

回到頁首
顯示: