VisualStyleElement.ExplorerBar.NormalGroupBackground 类

定义

为浏览器栏中一组常用项的背景提供 VisualStyleElement。 此类不能被继承。

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

示例

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

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

注解

Normal类的 VisualStyleElement.ExplorerBar.NormalGroupBackground 属性获取一个 VisualStyleElement ,它表示资源管理器栏中一组常见项目的背景,例如 Windows 资源管理器中的“文件和文件夹任务”组。

属性

Normal

获取表示浏览器栏中一组常用项的背景的视觉样式元素。

适用于

产品 版本
.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

另请参阅