当前位置:网站首页>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;
边栏推荐
- ITK编译remote库
- JDBC数据库连接池练习题
- [论文阅读] Diverse Image-to-Image Translation via Disentangled Representations
- [Turn] Typora_Markdown_ picture title (caption)
- UI遍历的初步尝试
- [LeetCode] Find the sum of the numbers from the root node to the leaf node
- egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
- Summary of Web Performance Testing Models
- 【无标题】
- Problems and solutions related to Chinese character set in file operations in ABAP
猜你喜欢
随机推荐
翻译工具-翻译工具下载批量自动一键翻译免费
C语言头文件组织与包含原则
RedHat红帽RHEL7安装与使用,VMware Workstation16 Pro虚拟机的安装与使用
Research on Ethernet PHY Chip LAN8720A Chip
UI遍历的初步尝试
【UNR #6 C】稳健型选手(分治)(主席树)(二分)
[Turn] Typora_Markdown_ picture title (caption)
color socks problem
Teach you how to write performance test cases
惊掉你下巴,程序员编码竟然可以被 996 指数化
Sikuli's Automated Testing Technology Based on Pattern Recognition
Unity vertex animation
空间复杂度为O(1)的归并排序
基于设计稿识别的可视化低代码系统实践
【SSRF漏洞】实战演示 超详细讲解
实操|风控模型中常用的这三种预测方法与多分类场景的实现
以太网PHY芯片LAN8720A芯片研究
彩色袜子题
破产企业的职工退休怎么办?
eyb:Redis学习(4)