private void button1_Click(object sender, EventArgs e)
        {
            foreach (Control cn in this.Controls)
            {
                if (cn is CheckBox)
                {
                    CheckBox ch = cn as CheckBox;
                    ch.Checked = true;
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            foreach(Control cc in this.Controls)
            {
                if(cc is CheckBox)
                {
                    CheckBox ch = cc as CheckBox;
                    ch.Checked = false;
                }
            }
        }
    }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
猜你喜欢
  • 2022-03-08
  • 2021-09-18
  • 2022-12-23
  • 2021-06-02
  • 2021-09-17
  • 2021-11-23
  • 2022-12-23
相关资源
相似解决方案