private Font _Font = new Font("微软雅黑", 12); [Description("字体"), Category("自定义")] publicnew Font Font { get { return _Font; } set { _Font = value; label1.Font = value; } }
private Color _ForeColor = Color.FromArgb(62, 62, 62); [Description("字体颜色"), Category("自定义")] publicnew Color ForeColor { get { return _ForeColor; } set { label1.ForeColor = value; _ForeColor = value; } } privatestring _Text = "单选按钮"; [Description("文本"), Category("自定义")] publicstring TextValue { get { return _Text; } set { label1.Text = value; _Text = value; } } privatebool _checked = false; [Description("是否选中"), Category("自定义")] publicbool Checked { get { return _checked; } set { if (_checked != value) { _checked = value; if (base.Enabled) { if (_checked) { panel1.BackgroundImage = Properties.Resources.radioButton1; } else { panel1.BackgroundImage = Properties.Resources.radioButton0; } } else { if (_checked) { panel1.BackgroundImage = Properties.Resources.radioButton10; } else { panel1.BackgroundImage = Properties.Resources.radioButton00; } } SetCheck(value);
privatevoidUCRadioButton_Load(object sender, EventArgs e) { if (this.Parent != null && this._checked) { foreach (Control c inthis.Parent.Controls) { if (c is UCRadioButton && c != this) { UCRadioButton uc = (UCRadioButton)c; if (_groupName == uc.GroupName && uc.Checked) { Checked = false; return; } } } } }
来看下完整的代码吧
// 版权所有 黄正辉 交流群:568015492 QQ:623128629 // 文件名称:UCRadioButton.cs // 创建日期:2019-08-15 16:03:13 // 功能描述:RadioButton // 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms;
private Font _Font = new Font("微软雅黑", 12); [Description("字体"), Category("自定义")] publicnew Font Font { get { return _Font; } set { _Font = value; label1.Font = value; } }
private Color _ForeColor = Color.FromArgb(62, 62, 62); [Description("字体颜色"), Category("自定义")] publicnew Color ForeColor { get { return _ForeColor; } set { label1.ForeColor = value; _ForeColor = value; } } privatestring _Text = "单选按钮"; [Description("文本"), Category("自定义")] publicstring TextValue { get { return _Text; } set { label1.Text = value; _Text = value; } } privatebool _checked = false; [Description("是否选中"), Category("自定义")] publicbool Checked { get { return _checked; } set { if (_checked != value) { _checked = value; if (base.Enabled) { if (_checked) { panel1.BackgroundImage = Properties.Resources.radioButton1; } else { panel1.BackgroundImage = Properties.Resources.radioButton0; } } else { if (_checked) { panel1.BackgroundImage = Properties.Resources.radioButton10; } else { panel1.BackgroundImage = Properties.Resources.radioButton00; } } SetCheck(value);
Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。
Rocky Linux
Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。