通过


VisualStyleElement.ExplorerBar.HeaderPin 类

定义

为资源管理器栏的VisualStyleElement”按钮(显示为推送引脚)的每个状态提供对象。 无法继承此类。

public: ref class VisualStyleElement::ExplorerBar::HeaderPin abstract sealed
public static class VisualStyleElement.ExplorerBar.HeaderPin
type VisualStyleElement.ExplorerBar.HeaderPin = class
Public Class VisualStyleElement.ExplorerBar.HeaderPin
继承
VisualStyleElement.ExplorerBar.HeaderPin

示例

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

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

注解

类的每个属性 VisualStyleElement.ExplorerBar.HeaderPin 返回 VisualStyleElement 资源管理器栏的 “自动隐藏 ”按钮的不同状态。

属性

名称 说明
Hot

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

Normal

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

Pressed

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

SelectedHot

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

SelectedNormal

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

SelectedPressed

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

适用于

另请参阅