Share via


VisualStyleElement.MenuBand.NewApplicationButton.HotChecked Vlastnost

Definice

Získá prvek vizuálního stylu, který představuje nové tlačítko aplikace v aktivních a kontrolovaných stavech.

public:
 static property System::Windows::Forms::VisualStyles::VisualStyleElement ^ HotChecked { System::Windows::Forms::VisualStyles::VisualStyleElement ^ get(); };
public static System.Windows.Forms.VisualStyles.VisualStyleElement HotChecked { get; }
static member HotChecked : System.Windows.Forms.VisualStyles.VisualStyleElement
Public Shared ReadOnly Property HotChecked As VisualStyleElement

Hodnota vlastnosti

A VisualStyleElement , který představuje tlačítko nové aplikace v horkém a zaškrtnutém stavu.

Příklady

Následující příklad kódu ukazuje, jak vytvořit VisualStyleRenderer s VisualStyleElement vrácenou HotChecked vlastností. Pokud chcete tento příklad spustit, vložte ho do formuláře Windows Form. Zpracování události formuláře Paint a volání DrawVisualStyleElementMenuBandNewApplicationButton6 metody z Paint metody zpracování událostí, předání e jako PaintEventArgs.

public void DrawVisualStyleElementMenuBandNewApplicationButton6(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.MenuBand.NewApplicationButton.HotChecked))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.MenuBand.NewApplicationButton.HotChecked);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.MenuBand.NewApplicationButton.HotChecked",
             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 DrawVisualStyleElementMenuBandNewApplicationButton6(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.MenuBand.NewApplicationButton.HotChecked)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.MenuBand.NewApplicationButton.HotChecked)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.MenuBand.NewApplicationButton.HotChecked", _
          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

Vlastnost vrácenou VisualStyleElementHotChecked vlastností můžete použít k vytvoření objektu VisualStyleRenderer.

Platí pro