VisualStyleElement.ExplorerBar.NormalGroupCollapse 类

定义

为浏览器栏中一组常见项的折叠按钮的每种状态提供 VisualStyleElement 对象。 此类不能被继承。

public static class VisualStyleElement.ExplorerBar.NormalGroupCollapse
继承
VisualStyleElement.ExplorerBar.NormalGroupCollapse

示例

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

public void DrawVisualStyleElementExplorerBarNormalGroupCollapse1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.ExplorerBar.NormalGroupCollapse.Normal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.ExplorerBar.NormalGroupCollapse.Normal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.ExplorerBar.NormalGroupCollapse.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));
}

注解

对于资源管理器栏中一组常见项目(如 Windows 资源管理器中的“文件和文件夹任务”组)的不同状态,类的每个属性VisualStyleElement.ExplorerBar.NormalGroupCollapse都会获取VisualStyleElement一个 。

属性

Hot

获取表示浏览器栏中一组常见项的热折叠按钮的视觉样式元素。

Normal

获取表示浏览器栏中一组常见项的正常折叠按钮的视觉样式元素。

Pressed

获取表示浏览器栏中一组常见项的按下的折叠按钮的视觉样式元素。

适用于

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另请参阅