语言

VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed 属性

定义

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

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

属性值

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

示例

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

public void DrawVisualStyleElementExplorerBarHeaderPin6(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed",
             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 DrawVisualStyleElementExplorerBarHeaderPin6(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed", _
          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 属性返回 SelectedPressed 来创建一个 VisualStyleRenderer。

适用于