通过


VisualStyleElement.StartPanel.LogOffButtons 类

定义

VisualStyleElement菜单中的“注销”和“关闭”按钮的每个状态提供对象。 无法继承此类。

public: ref class VisualStyleElement::StartPanel::LogOffButtons abstract sealed
public static class VisualStyleElement.StartPanel.LogOffButtons
type VisualStyleElement.StartPanel.LogOffButtons = class
Public Class VisualStyleElement.StartPanel.LogOffButtons
继承
VisualStyleElement.StartPanel.LogOffButtons

示例

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

public void DrawVisualStyleElementStartPanelLogOffButtons1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.StartPanel.LogOffButtons.Normal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.StartPanel.LogOffButtons.Normal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.StartPanel.LogOffButtons.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 DrawVisualStyleElementStartPanelLogOffButtons1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.StartPanel.LogOffButtons.Normal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.StartPanel.LogOffButtons.Normal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.StartPanel.LogOffButtons.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.StartPanel.LogOffButtons 返回一个 VisualStyleElement 不同状态的 “注销 ”和 “关闭 ”按钮。

属性

名称 说明
Hot

获取表示处于热状态的 注销关闭 按钮的视觉样式元素。

Normal

获取表示处于正常状态的 注销关闭 按钮的视觉样式元素。

Pressed

获取表示处于按下状态的 注销关闭 按钮的视觉样式元素。

适用于

另请参阅