Język

MenuDesigner.GetEmptyDesignTimeHtml Metoda

Definicja

Pobiera znacznik renderujący symbol zastępczy skojarzonej kontrolki w czasie projektowania, gdy w przeciwnym razie nie jest dostępny żaden znacznik.

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

Zwraca

Ciąg zawierający tekst znaczników renderowany do symbolu zastępczego na powierzchni projektowej.

Przykłady

Poniższy przykład kodu pokazuje, jak zastąpić metodę GetEmptyDesignTimeHtml w klasie dziedziczonej MenuDesigner z klasy. Metoda przesłonięta zmienia wygląd kontrolki pochodzącej Menu z klasy w czasie projektowania. Przykład generuje znaczniki dla symbolu zastępczego zawierającego komunikat wskazujący, że żadne elementy menu nie są zdefiniowane dla skojarzonej kontrolki.

// 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

Uwagi

Metoda GetEmptyDesignTimeHtml generuje znaczniki dla symbolu zastępczego określającego Menu nazwę kontrolki i komunikat z instrukcją użycia edytora kolekcji w celu dodania elementów.

Dotyczy

Zobacz też