VisualStyleElement.Window.CloseButton Třída

Definice

Poskytuje VisualStyleElement objekty pro každý stav zavřít tlačítko okna. Tato třída se nemůže dědit.

public: ref class VisualStyleElement::Window::CloseButton abstract sealed
public static class VisualStyleElement.Window.CloseButton
type VisualStyleElement.Window.CloseButton = class
Public Class VisualStyleElement.Window.CloseButton
Dědičnost
VisualStyleElement.Window.CloseButton

Příklady

Následující příklad kódu ukazuje, jak vytvořit VisualStyleRenderer s VisualStyleElement vrácenou Normal vlastností . Pokud chcete spustit tento příklad, vložte ho do formuláře Windows Form. Zpracujte Paint událost formuláře a zavolejte metodu DrawVisualStyleElementWindowCloseButton1Paint z metody zpracování událostí a předejte e ji jako PaintEventArgs.

public void DrawVisualStyleElementWindowCloseButton1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Window.CloseButton.Normal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Window.CloseButton.Normal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Window.CloseButton.Normal",
             this.Font, Brushes.Black, new Point(10, 10));
    }
    else
        e.Graphics.DrawString("This element is not defined in the current visual style.",
             this.Font, Brushes.Black, new Point(10, 10));
}
Public Sub DrawVisualStyleElementWindowCloseButton1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Window.CloseButton.Normal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Window.CloseButton.Normal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Window.CloseButton.Normal", _
          Me.Font, Brushes.Black, New Point(10, 10))
    Else
        e.Graphics.DrawString("This element is not defined in the current visual style.", _
          Me.Font, Brushes.Black, New Point(10, 10))
    End If
End Sub

Poznámky

Každá vlastnost VisualStyleElement.Window.CloseButton třídy vrátí VisualStyleElement pro jiný stav tlačítka Zavřít okna.

Vlastnosti

Disabled

Získá vizuální styl prvek, který představuje tlačítko Zavřít v zakázaném stavu.

Hot

Získá prvek vizuálního stylu, který představuje tlačítko Zavřít v horkém stavu.

Normal

Získá prvek vizuálního stylu, který představuje tlačítko Zavřít v normálním stavu.

Pressed

Získá prvek vizuálního stylu, který představuje tlačítko Zavřít ve stisknutém stavu.

Platí pro

Viz také