遍历winform 窗体控件
//遍历窗体控件并给控件赋值
private void Control_Load(object sender, EventArgs e)
{
foreach (Control Ctr in this.Controls)
{
if (Ctr is System.Windows.Forms.CheckBox)
{
checkBox1.Checked = true;
}
else if (Ctr is TextBox)
{
this.textBox1.Text = "赋值数据";
}
}
}