I would like to only have single checkbox selected at a time. My program reads from a textfile and creates checkboxes according to how many \"answers\" there are in the text
Ok this should do what you want to do, either onClick or on CheckChanged but the answer is from CheckChanged.
Put this in the chk_CheckChanged event and add the chk_CheckChanged event to each Checkbox you add.
CheckBox tmp = (CheckBox)sender;
foreach (CheckBox c in flowLayoutPanel1.Controls)
{
c.CheckedChanged -= chk_CheckedChanged;
c.Checked = false;
}
tmp.Checked = true;
foreach (CheckBox c in flowLayoutPanel1.Controls)
{
c.CheckedChanged += chk_CheckedChanged;
}