Hi mate,
If you want to itterate through the checkboxes and inform the user via MessageBox which ones are checked you can use this piece of code. It roughly demonstrates how to itterate through controls of typ CheckBox.
private void button1_Click(object sender, EventArgs e)
{
string chckd = "";
foreach (Control ctr in groupBox1.Controls.OfType<CheckBox>())
{
if (((CheckBox)ctr).Checked == true)
{
chckd += ((CheckBox)ctr).Text + ", ";
}
}
chckd += "are checked!";
MessageBox.Show(chckd);
}
Please note I put them inside GroupBox so its easier for me to itterate. You can than use your piece of code in this event to fetch the activity depending on the text that is set next to the CheckBox.
Tell me if this helps.
Regards