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
It's so simple to achieve what you want, however it's also so strange:
//We need this to hold the last checked CheckBox
CheckBox lastChecked;
private void chk_Click(object sender, EventArgs e) {
CheckBox activeCheckBox = sender as CheckBox;
if(activeCheckBox != lastChecked && lastChecked!=null) lastChecked.Checked = false;
lastChecked = activeCheckBox.Checked ? activeCheckBox : null;
}