VisualStyleElement.Window.MinCaption 类     
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为最小化窗口的标题栏的每种状态提供 VisualStyleElement 对象。 此类不能被继承。
public: ref class VisualStyleElement::Window::MinCaption abstract sealedpublic static class VisualStyleElement.Window.MinCaptiontype VisualStyleElement.Window.MinCaption = classPublic Class VisualStyleElement.Window.MinCaption- 继承
- 
				VisualStyleElement.Window.MinCaption
示例
下面的代码示例演示如何使用 VisualStyleElement 属性返回的 Active 创建 VisualStyleRenderer 。 若要运行此示例,请将其粘贴到 Windows 窗体中。 处理窗体的事件Paint,并从Paint事件处理方法调用 DrawVisualStyleElementWindowMinCaption1 方法,作为 ePaintEventArgs传递。
public void DrawVisualStyleElementWindowMinCaption1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Window.MinCaption.Active))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Window.MinCaption.Active);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Window.MinCaption.Active",
             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 DrawVisualStyleElementWindowMinCaption1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Window.MinCaption.Active)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Window.MinCaption.Active)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Window.MinCaption.Active", _
          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.Window.MinCaption 为最小化窗口的标题栏的不同状态返回 VisualStyleElement 。
属性
| Active | 获取表示最小化活动窗口的标题栏的视觉样式元素。 | 
| Disabled | 获取表示最小化禁用窗口的标题栏的视觉样式元素。 | 
| Inactive | 获取表示最小化非活动窗口的标题栏的视觉样式元素。 |