摘要: 首先,要想遍历,就必须找到你想找的表单里面的所有控件,然后一个个的逐一比对,当找到了你需要的控件的时候,再做你需要的操作。1、foreach方法foreach (Control control in 表单信息.Controls){ if (control is 控件类型) { 控件类型t = (控件类型)control; //逻辑代码 } }示例:foreach (Control control in this.Controls){ if (control is TextBox) { TextBox t =... 阅读全文
posted @ 2011-11-28 15:17 月夜清风 阅读(11397) 评论(0) 推荐(2) 编辑