通过


VisualStyleElement.ExplorerBar.HeaderPin.SelectedHot 属性

定义

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

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

属性值

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

示例

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

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

适用于