通过


VisualStyleElement.ExplorerBar.HeaderPin.SelectedNormal 属性

定义

获取表示处于正常状态的所选 自动隐藏 按钮(显示为推送引脚)的视觉样式元素。

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

属性值

表示 VisualStyleElement 处于正常状态的所选 “自动隐藏 ”按钮。

示例

下面的代码示例演示如何使用属性返回SelectedNormal的值创建 a。VisualStyleRendererVisualStyleElement 若要运行此示例,请将其粘贴到 Windows 窗体中。 处理表单 Paint 的事件,并从事件处理方法调用 DrawVisualStyleElementExplorerBarHeaderPin4 该方法 Paint ,并传递 ePaintEventArgs

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

注解

可以使用 VisualStyleElement 属性返回 SelectedNormal 来创建一个 VisualStyleRenderer

适用于