C# winform 遍历所有页面的所有控件 ,然后判断组件类型是什么
//循环整个form上的控件 foreach (Control c in this.Controls) { //看看是不是checkbox if (c is CheckBox) { //将找到的control转化成checkbox CheckBox ck = c as CheckBox; //判断是否选中 if (ck.Checked) { //该复选框被选择 } }else if ... }
本文来自博客园,作者:岑惜,转载请注明原文链接:https://www.cnblogs.com/c2g5201314/p/14492902.html
响应开源精神相互学习,内容良币驱除劣币