共用方式為


PanelContainerDesigner.FrameCaption 屬性

定義

取得相關聯 Panel 控制項上顯示的標題。

public:
 virtual property System::String ^ FrameCaption { System::String ^ get(); };
public override string FrameCaption { get; }
member this.FrameCaption : string
Public Overrides ReadOnly Property FrameCaption As String

屬性值

包含面板標題的字串。

範例

下列程式代碼範例示範如何在設計時間覆寫 FrameCaption 繼承自 PanelContainerDesigner 類別的 類別中的 屬性,以變更衍生自 類別的 Panel 控件外觀。 如果未定義任何標題,此範例會提供相關聯控件的預設標題。

// Provide a design-time caption for the panel.
public override string FrameCaption 
{
    get
    {
        // If the FrameCaption is empty, use the panel control ID.
        string localCaption = base.FrameCaption;
        if (localCaption == null || localCaption == "")
            localCaption = ((Panel)Component).ID.ToString();

        return localCaption;
    }
} // FrameCaption
' Provide a design-time caption for the panel.
Public Overrides ReadOnly Property FrameCaption() As String
    Get
        ' If the FrameCaption is empty, use the panel control ID.
        Dim localCaption As String = MyBase.FrameCaption
        If localCaption Is Nothing Or localCaption = "" Then
            localCaption = CType(Component, Panel).ID.ToString()
        End If

        Return localCaption
    End Get
End Property ' FrameCaption

備註

屬性會 FrameCaptionGroupingText 回相關聯 Panel 控件的屬性。

適用於

另請參閱