MenuDesigner.GetEmptyDesignTimeHtml メソッド

定義

マークアップを別の方法で使用できない場合に、関連付けられたコントロールのプレースホルダーをデザイン時に表示するためのマークアップを取得します。

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

戻り値

デザイン サーフェイスにプレースホルダーを表示するためのマークアップ テキストを含んだ文字列。

次のコード例は、 クラスから継承されたクラスの メソッドをオーバーライド GetEmptyDesignTimeHtml する方法を MenuDesigner 示しています。 オーバーライドされたメソッドは、デザイン時に クラスから派生したコントロールの外観を 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 追加するように指示するメッセージを指定するプレースホルダーのマークアップを生成します。

適用対象

こちらもご覧ください