VisualStyleElement.ExplorerBar.HeaderPin.SelectedPressed 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取表示处于按下状态的所选 自动隐藏 按钮(显示为推送引脚)的视觉样式元素。
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 处于按下状态的所选 “自动隐藏 ”按钮。
示例
下面的代码示例演示如何使用属性返回SelectedPressed的值创建 a。VisualStyleRendererVisualStyleElement 若要运行此示例,请将其粘贴到 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。