- //遍历窗体上所有CheckBox控件 .net winform
- StringBuilder sb = new StringBuilder();
- foreach (Control c in Controls)
- {
- if (c is CheckBox)
- {
- if (((CheckBox)c).Checked == true )
- {
- sb.Append("," );
- sb.Append(c.Text.ToString());
- }
- }
- }
- sb.Append("," );
- textBox1.Text = sb.ToString();
遍历窗体上所有CheckBox控件 .net winform
WinForm中遍历CheckBox
最新推荐文章于 2022-03-10 12:17:47 发布
本文介绍了一种在.NET WinForm应用程序中遍历窗体上的所有CheckBox控件的方法,并展示了如何将选中的CheckBox文本收集并显示在一个TextBox中。
2万+

被折叠的 条评论
为什么被折叠?



