当前位置:网站首页>C# winform 单选框
C# winform 单选框
2022-08-10 01:18:00 【ou.cs】
private void radioButton_Click(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
for (int i = 0; i < radioGroup.Controls.Count; i++)
{
#region 1.一个单选框被选中时,另一个改变状态
if (radioButton != radioGroup.Controls[i])
{
(radioGroup.Controls[i] as RadioButton).Checked = false;
}
else
{
state = i;
}
#endregion
}
}
foreach (RadioButton item in radioGroup.Controls)
{
item.Click += new EventHandler(radioButton_Click!);
}
(radioGroup.Controls[0] as RadioButton)!.Checked = true;
边栏推荐
- unity 报错 Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe‘ code“ in Pla
- 华为HCIE云计算之FC添加ipsan数据存储
- STM32F103驱动HCSR04超声波测距显示
- 51单片机驱动HMI串口屏,串口屏的下载方式
- 对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig“ 或 “jsconfig“ 中设置 “experimentalDecorators“ 选项以删除此警告
- volatile 关键字(修饰符 volatile 告诉编译器,变量的值可能以程序未明确指定的方式被改变)
- 2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
- Golang nil的妙用
- Sikuli's Automated Testing Technology Based on Pattern Recognition
- RedHat红帽RHEL7安装与使用,VMware Workstation16 Pro虚拟机的安装与使用
猜你喜欢
随机推荐
Shader Graph learns various special effects cases
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte
[语法糖] 关于类别字符串到类别数字id的映射
Solve the problem of sed replacement text containing special characters such as "/" and "#"
Aptos 深度解读:机遇、挑战与风险
微信账户体系科普:什么是UnionId、OpenId与wxopenid?
Interdepartmental Communication Skills
Unity image is blurry after using long image
unity编辑器扩展界面使用 List
Entity FrameWork Core教程,从基础应用到原理实战
什么是持续测试?
Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
type-C 边充电边听歌(OTG) PD芯片方案,LDR6028 PD充电加OTG方案
已备案域名用国外服务器会不会掉备案?
Premint工具,作为普通人我们需要了解哪些内容?
谷歌翻译器-谷歌翻译器软件批量自动翻译
ABAP 里文件操作涉及到中文字符集的问题和解决方案
实操|风控模型中常用的这三种预测方法与多分类场景的实现
el-input保留一位小数点
UI遍历的初步尝试