Share via


MenuDesigner.GetEmptyDesignTimeHtml 方法

定義

在設計階段無其他標記可供使用時,取得為關聯控制項呈現替代符號的標記。

protected:
 override System::String ^ GetEmptyDesignTimeHtml();
protected override string GetEmptyDesignTimeHtml ();
override this.GetEmptyDesignTimeHtml : unit -> string
Protected Overrides Function GetEmptyDesignTimeHtml () As String

傳回

字串,包含在設計介面上呈現給替代符號的標記文字。

範例

下列程式碼範例示範如何在繼承自 MenuDesigner 類別的類別中覆寫 GetEmptyDesignTimeHtml 方法。 覆寫的方法會變更在設計階段衍生自 Menu 類別的控制面板。 此範例會產生預留位置的標記,其中包含訊息,指出關聯控制項未定義功能表項目。

// Generate the design-time markup for the control 
// when the template is empty.
protected override string GetEmptyDesignTimeHtml()
{
    string noElements = "Contains no menu items.";

    return CreatePlaceHolderDesignTimeHtml(noElements);
} // GetEmptyDesignTimeHtml
' Generate the design-time markup for the control 
' when the template is empty.
Protected Overrides Function GetEmptyDesignTimeHtml() As String

    Dim noElements As String = "Contains no menu items."

    Return CreatePlaceHolderDesignTimeHtml(noElements)

End Function ' GetEmptyDesignTimeHtml

備註

方法 GetEmptyDesignTimeHtml 會產生預留位置的標記,指定 Menu 控制項名稱和訊息,指示您使用集合編輯器來新增專案。

適用於

另請參閱