Add for example return false to the end of the method.
Another thing, where is the formatted string going? Currently nowhere. Also this method would end in the first selected item, is that what you want?
If you want to show for example a message box if every check box in the list isn't selected, could you simplify this to something like:
public bool isCheckboxSelected()
{
bool noProblems;
noProblems = CheckBoxList1.Items.Count == CheckBoxList1.SelectedItems.Count;
if (!noProblems )
{
System.Windows.MessageBox.Show("you have to select each check box");
}
return noProblems ;
}
[edit]Enhanced the code example to have only one exit point[/edit]