本帖最后由 wjx515628 于 2013-09-05 01:59:24 编辑

解决方案 »

  1.   

    没看懂要表达的意思
    button1_Click事件是向flowLayoutPanel1中添加控件
    全选在那做的?没看到
      

  2.   

    全选全不选
     private void checkBox1_CheckedChanged(object sender, EventArgs e)
            {
                CheckBox all = sender as CheckBox;
                foreach (Control ctl in flowLayoutPanel1.Controls)
                {
                    if (ctl is Panel)
                    {
                        Panel p = ctl as Panel;
                        foreach (var ss in p.Controls)
                        {
                            if ((ss as CheckBox) is CheckBox)
                            {
                                if ((ss as CheckBox).Checked)
                                {
                                    (ss as CheckBox).Checked = false;
                                }
                                else
                                {
                                    (ss as CheckBox).Checked = true;
                                }
                            }
                            else
                            {
                               
                            }
                        }
                    }
                }
            }