VisualStyleElement.Button.RadioButton 类     
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为单选按钮控件的不同状态提供 VisualStyleElement 对象。 此类不能被继承。
public: ref class VisualStyleElement::Button::RadioButton abstract sealedpublic static class VisualStyleElement.Button.RadioButtontype VisualStyleElement.Button.RadioButton = classPublic Class VisualStyleElement.Button.RadioButton- 继承
- 
				VisualStyleElement.Button.RadioButton
示例
下面的代码示例演示如何使用 VisualStyleElement 属性返回的 VisualStyleElement.Button.RadioButton 创建 VisualStyleRenderer 。 若要运行此示例,请将其粘贴到 Windows 窗体中。 处理窗体的事件Paint,并从Paint事件处理方法调用 DrawVisualStyleElement_Button_RadioButton1 方法,作为 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 | 获取表示处于取消选中状态的按下的单选按钮的视觉样式元素。 |