WPF_RadioButton使用

属性说明

Content=“radioButton” //显示信息
IsChecked=“True” //默认选中
GroupName=“carSize” //多个单选框设置同一GroupName,则只能多选一,实现单选效果
HorizontalAlignment=“Left” //控件位置-水平居中
VerticalAlignment=“Top” //控件位置-垂直居中
FontSize=“12” //文字大小
FontWeight=“Bold” //文字加粗显示


选中时改变颜色

        private void radioButton1_Checked(object sender, EventArgs e)
        {
            this.radioButton1.ForeColor =
            this.radioButton1.Checked ?
            Color.Red :
            Color.Black;
        }

  

猜你喜欢

转载自www.cnblogs.com/shyw/p/11842521.html