I'm working on a program that will tell what level a programmer is at beginner, intermediate, or expert based on 32 subjects from a test in Code Complete 2nd Edition. I'm using 32 check boxes and one method to tell which ones are clicked. The problem is that when I check to see if the check boxes checked property is equal to true, it gets the result before the check box actually becomes checked. Here is all of my source code (so far):
public partial class Main : Form
{
private int baseScore = 0;
public Main()
{
InitializeComponent();
}
private void buttonCalculateScore_Click(object sender, EventArgs e)
{
DetermineLevelOfProgrammer();
}
private void DetermineLevelOfProgrammer()
{
if ((baseScore >= 0) || (baseScore <= 14))
{
labelYourScore.Text += " " + baseScore.ToString();
labelDescription.Text = "You are a beginning programmer, probably in your first year of computer \n"+
"science in school or teaching yourself your first programming language. ";
}
// Do the other checks here!
}
// If checkbox is checked then increment base score,
// otherwise decrement base score.
private void checkBoxVariant_CheckedChanged(object sender, EventArgs e)
{
if (checkBoxVariant.Checked)
baseScore++;
else
baseScore--;
}
}