RibbonFactory 介面

定義

提供方法,可用來建立 Microsoft Office 功能區自訂的功能區控制項。

public interface class RibbonFactory
[System.Runtime.InteropServices.Guid("1012BDD2-303F-4464-A64B-3026BD91C31E")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface RibbonFactory
[<System.Runtime.InteropServices.Guid("1012BDD2-303F-4464-A64B-3026BD91C31E")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type RibbonFactory = interface
Public Interface RibbonFactory
屬性

範例

下列範例會 RibbonFactory 存取 Excel 2010 活頁簿專案功能區程式代碼檔案中項目的實例。 此程式代碼會使用 物件中的 RibbonFactory 方法來建立下拉式專案、功能表和按鈕。 若要檢視完整的範例,請參閱 逐步解說:在運行時間更新功能區上的控件

private RibbonDropDownItem CreateRibbonDropDownItem()
{
    return this.Factory.CreateRibbonDropDownItem();
}
private RibbonMenu CreateRibbonMenu()
{
    return this.Factory.CreateRibbonMenu();
}
private RibbonButton CreateRibbonButton()
{
    RibbonButton button = this.Factory.CreateRibbonButton();
    button.Click += new RibbonControlEventHandler(button_Click);
    return button;
}

Private Function CreateRibbonDropDownItem() As RibbonDropDownItem
    Return Me.Factory.CreateRibbonDropDownItem()
End Function

Private Function CreateRibbonMenu() As RibbonMenu
    Return Me.Factory.CreateRibbonMenu()
End Function

Private Function CreateRibbonButton() As RibbonButton
    Dim button As RibbonButton = Me.Factory.CreateRibbonButton()
    AddHandler (button.Click), AddressOf Button_Click
    Return button
End Function

備註

注意

這個介面是由 Visual Studio Tools for Office Runtime 實作, 並不能實作於您的程式碼中。 如需詳細資訊,請參閱 Visual Studio Tools for Office Runtime Overview

屬性

RibbonPosition

取得 RibbonPositionStatics 物件,可用來指定控制項、群組或索引標籤在功能區自訂中的位置。

方法

CreateRibbonBox()

建立 RibbonBox 物件,排列並對齊自訂功能區上的控制項。

CreateRibbonButton()

RibbonButton,代表自訂功能區上的按鈕。

CreateRibbonButtonGroup()

建立 RibbonButtonGroup 物件,代表功能區上的一組按鈕。

CreateRibbonCheckBox()

建立 RibbonCheckBox 物件,代表功能區上的核取方塊。

CreateRibbonComboBox()

建立 RibbonComboBox 物件,代表自訂功能區上的下拉式方塊。

CreateRibbonDialogLauncher()

建立 RibbonDialogLauncher 物件,代表群組上可用來開啟對話方塊的小型標準化圖示。

CreateRibbonDropDown()

建立 RibbonDropDown 物件,代表使用者可以選擇的項目清單,以及使用者可以按一下的功能區按鈕清單。

CreateRibbonDropDownItem()

建立 RibbonDropDownItem 物件,代表下拉式控制項中的項目。

CreateRibbonEditBox()

建立 RibbonEditBox 物件,代表功能區上的編輯方塊。

CreateRibbonGallery()

建立 RibbonGallery 物件,代表顯示 RibbonDropDownItem 物件和 RibbonButton 控制項之功能表的控制項。

CreateRibbonGroup()

建立 RibbonGroup,代表功能區索引標籤上的一組控制項。

CreateRibbonLabel()

建立 RibbonLabel,代表 RibbonGroupRibbonBox 上的標籤。

CreateRibbonManager(IRibbonExtension[])

建立 IRibbonExtensibility 物件,代表功能區自訂。

CreateRibbonMenu()

建立 RibbonMenu,代表功能區索引標籤或 Microsoft Office 功能表上的功能表。

CreateRibbonReadOnlyCollection()

建立 RibbonMenu 物件,提供功能區自訂中 IRibbonExtension 物件的存取。

CreateRibbonSeparator()

建立 RibbonSeparator 物件,代表功能區上的群組或功能表分隔符號控制項。

CreateRibbonSplitButton()

建立 RibbonSplitButton 物件,結合按鈕或切換按鈕和下拉式功能表。

CreateRibbonTab()

建立 RibbonTab 物件,在功能區上包含一或多組控制項。

CreateRibbonToggleButton()

建立 RibbonToggleButton,代表功能區上的切換按鈕控制項。

適用於