RibbonEditBox 介面

表示功能區上的編輯方塊。

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

語法

'宣告
<GuidAttribute("14396b39-63c4-4fc2-92fe-cbccdbe5f306")> _
Public Interface RibbonEditBox _
    Inherits RibbonControl, RibbonComponent, IComponent, IDisposable
[GuidAttribute("14396b39-63c4-4fc2-92fe-cbccdbe5f306")]
public interface RibbonEditBox : RibbonControl, 
    RibbonComponent, IComponent, IDisposable

RibbonEditBox 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 Enabled 取得或設定值,指出此 RibbonControl 是否已啟用。 (繼承自 RibbonControl)。
公用屬性 Id 取得 Microsoft Office 用來識別這個 RibbonControl 物件的字串。 (繼承自 RibbonControl)。
公用屬性 Image 取得或設定顯示在編輯方塊上的影像。
公用屬性 ImageName 取得或設定可在 LoadImage 事件處理常式中用來識別影像的名稱。
公用屬性 KeyTip 取得或設定這個 RibbonEditBox 的鍵盤快速鍵。
公用屬性 Label 取得或設定出現在這個 RibbonEditBox 上的文字。
公用屬性 MaxLength 取得或設定值,指出此 RibbonEditBox 中的每個項目允許的最大字元數。
公用屬性 Name 取得或設定這個 RibbonComponent 的名稱。 (繼承自 RibbonComponent)。
公用屬性 OfficeImageId 取得或設定要顯示在按鈕上的影像 (如果您想要使用內建 Microsoft Office 圖示的話)。
公用屬性 Parent 取得 RibbonComponent,表示這個 RibbonComponent 的父代 (Parent)。 (繼承自 RibbonComponent)。
公用屬性 Ribbon 取得包含控制項階層架構的最上層 Ribbon 物件。 (繼承自 RibbonComponent)。
公用屬性 RibbonUI 基礎架構。取得 Microsoft Office 應用程式提供給功能區擴充性程式碼的 IRibbonUI 執行個體。 (繼承自 RibbonComponent)。
公用屬性 ScreenTip 取得或設定當使用者將游標移至 RibbonEditBox 上方時所顯示的提示文字。
公用屬性 ShowImage 取得或設定值,指出與 RibbonEditBox 關聯的影像是否可見。
公用屬性 ShowLabel 取得或設定值,指出這個 RibbonEditBox 的標籤是否可見。
公用屬性 Site 取得或設定與 IComponent 相關聯的 ISite。 (繼承自 IComponent)。
公用屬性 SizeString 取得或設定決定 RibbonEditBox 大小的字串。
公用屬性 SuperTip 取得或設定當使用者將游標移至 RibbonEditBox 上方時所顯示的多行提示文字。
公用屬性 Tag 取得或設定與這個 RibbonComponent 關聯的應用程式特定資料。 (繼承自 RibbonComponent)。
公用屬性 Text 取得或設定當編輯方塊第一次出現時顯示在這個 RibbonEditBox 中的文字。
公用屬性 Visible 取得或設定值,指出此 RibbonControl 是否為可見的。 (繼承自 RibbonControl)。

回頁首

方法

  名稱 說明
公用方法 Dispose 執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。 (繼承自 IDisposable)。
公用方法 PerformDynamicLayout 如果 RibbonComponent 具有像是動態功能表的動態父代 (Parent),而且配置未暫止,請呼叫父控制項的 Microsoft.Office.Core.IRibbonUI.InvalidateControl 方法。 (繼承自 RibbonComponent)。
公用方法 PerformLayout 如果 RibbonComponent 具有父代且配置未暫止,則會呼叫 Microsoft.Office.Core.IRibbonUI.InvalidateControl。 (繼承自 RibbonComponent)。
公用方法 ResumeLayout() 回復 SuspendLayout 方法的效果。 (繼承自 RibbonComponent)。
公用方法 ResumeLayout(Boolean) 回復 SuspendLayout 方法的效果。 (繼承自 RibbonComponent)。
公用方法 SuspendLayout 防止 Microsoft Office 應用程式重新整理功能區上控制項的狀態。 (繼承自 RibbonComponent)。

回頁首

事件

  名稱 說明
公用事件 Disposed 表示處理元件的 Disposed 事件的方法。 (繼承自 IComponent)。
公用事件 TextChanged 會在使用者變更 RibbonEditBox 中的文字時發生。

回頁首

備註

RibbonEditBox 控制項會顯示可讓使用者在其中輸入和編輯文字的標記方塊。

當您將 [EditBox] 控制項從 [工具箱] 的 [Office 功能區控制項] 索引標籤拖曳至功能區設計工具時,Visual Studio 會建立 RibbonEditBox 物件。

您可以在執行階段中使用 RibbonFactory 物件的 CreateRibbonEditBox 方法建立 RibbonEditBox。

有兩種方法可以存取 RibbonFactory 物件:

  • 使用功能區類別的 Factory 屬性。 請從功能區類別中的程式碼使用此方法。

  • 使用 Globals.Factory.GetRibbonFactory 方法。 請從功能區類別外的程式碼使用此方法。

這個控制項的某些屬性只能在功能區載入至 Office 應用程式前進行設定。 如需這些屬性的設定資訊,請參閱功能區物件模型概觀

注意事項注意事項

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

使用方式

本文件說明此類型用於以 .NET Framework 4 和 .NET Framework 4.5 為目標之 Office 專案的版本。在以 .NET Framework 3.5 為目標的專案中,此類型可能會有不同的成員,而為此類型提供的程式碼範例可能無法運作。如需此類型在以 .NET Framework 3.5 為目標之專案中的相關文件,請參閱下列 Visual Studio 2008 文件中的參考章節:https://go.microsoft.com/fwlink/?LinkId=160658

請參閱

參考

Microsoft.Office.Tools.Ribbon 命名空間

其他資源

功能區概觀

功能區設計工具

功能區物件模型概觀

如何:開始自訂功能區