VisualStyleElement.Button.RadioButton 类

定义

为单选按钮控件的不同状态提供 VisualStyleElement 对象。 此类不能被继承。

public: ref class VisualStyleElement::Button::RadioButton abstract sealed
public static class VisualStyleElement.Button.RadioButton
type VisualStyleElement.Button.RadioButton = class
Public Class VisualStyleElement.Button.RadioButton
继承
VisualStyleElement.Button.RadioButton

示例

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

public void DrawVisualStyleElement_Button_RadioButton1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Button.RadioButton.UncheckedNormal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Button.RadioButton.UncheckedNormal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Button.RadioButton.UncheckedNormal",
             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 DrawVisualStyleElement_Button_RadioButton1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Button.RadioButton.UncheckedNormal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Button.RadioButton.UncheckedNormal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Button.RadioButton.UncheckedNormal", _
          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.Button.RadioButton 返回 VisualStyleElement 单选按钮控件的不同状态。

属性

名称 说明
CheckedDisabled

获取表示处于选中状态的禁用单选按钮的视觉样式元素。

CheckedHot

获取表示处于选中状态的热单选按钮的视觉样式元素。

CheckedNormal

获取表示处于选中状态的普通单选按钮的视觉样式元素。

CheckedPressed

获取表示处于选中状态的按下单选按钮的视觉样式元素。

UncheckedDisabled

获取表示处于未选中状态的禁用单选按钮的视觉样式元素。

UncheckedHot

获取表示处于未选中状态的热单选按钮的视觉样式元素。

UncheckedNormal

获取表示处于未选中状态的普通单选按钮的视觉样式元素。

UncheckedPressed

获取表示处于未选中状态的按下单选按钮的视觉样式元素。

适用于

另请参阅