VisualStyleElement.ExplorerBar.HeaderBackground Classe

Définition

Fournit un VisualStyleElement pour l'arrière-plan du volet d'exploration. Cette classe ne peut pas être héritée.

public: ref class VisualStyleElement::ExplorerBar::HeaderBackground abstract sealed
public static class VisualStyleElement.ExplorerBar.HeaderBackground
type VisualStyleElement.ExplorerBar.HeaderBackground = class
Public Class VisualStyleElement.ExplorerBar.HeaderBackground
Héritage
VisualStyleElement.ExplorerBar.HeaderBackground

Exemples

L’exemple de code suivant montre comment créer un VisualStyleRenderer avec le VisualStyleElement retourné par la Normal propriété . Pour exécuter cet exemple, collez-le dans un Windows Form. Gérez l’événement du Paint formulaire et appelez la DrawVisualStyleElementExplorerBarHeaderBackground1 méthode à partir de la Paint méthode de gestion des événements, en passant e comme PaintEventArgs.

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

Remarques

La Normal propriété de la VisualStyleElement.ExplorerBar.HeaderBackground classe obtient un VisualStyleElement qui représente l’arrière-plan du Explorer Bar.

Propriétés

Normal

Obtient un élément de style visuel qui représente l'arrière-plan du volet d'exploration.

S’applique à

Voir aussi