VisualStyleElement.Button.CheckBox.MixedNormal 属性

定义

获取表示处于不确定状态的正常复选框的视觉样式元素。

public static System.Windows.Forms.VisualStyles.VisualStyleElement MixedNormal { get; }

属性值

VisualStyleElement,它表示处于不确定状态的正常复选框。

示例

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

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

注解

可以使用 VisualStyleElement 属性返回的 MixedNormal 来创建 VisualStyleRenderer

适用于

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