MenuDesigner.GetEmptyDesignTimeHtml 方法

定义

如果没有以其他方式提供标记,则获取在设计时呈现关联控件的占位符的标记。

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

返回

String

一个字符串,包含在设计图面上呈现到占位符的标记文本。

示例

下面的代码示例演示如何重写 GetEmptyDesignTimeHtmlMenuDesigner 类继承的类中的方法。 重写的方法更改在设计时派生自类的 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 控件名称和一条消息,指示使用集合编辑器添加项。

适用于

另请参阅