您当前的位置: 首页 >  郑建广视觉 ui

Winform UI界面设计例程——自定义radioButton

郑建广视觉 发布时间:2022-06-06 09:13:55 ,浏览量:5

winform c#界面设计 自定义控件 radioButton

新建winform项目,添加新类,并重新命名为myRadioButton,打开新类,并引用如下

using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;

新类继承radioButton

    public class myRadioButton : RadioButton
    {
    }

定义字段

private Color checkedColor = Color.MediumSlateBlue;

private Color unCheckedColor = Color.Gray;

定义属性

public Color CheckedColor

{

get { return checkedColor; }

set

{

checkedColor = value;

this.Invalidate();

}

}

public Color UnCheckedColor

{

get { return unCh

关注
打赏
1688896170
查看更多评论

郑建广视觉

暂无认证

  • 5浏览

    0关注

    137博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0500s