Exemplo n.º 1
0
        private void SetupProblems()
        {
            int xPosition = 0, xoffset = 10, column;
            int yPosition = 0, yoffset = 77, row;

            for (int problemIndex = 0; problemIndex < numberOfProblems; problemIndex++)
            {
                MathProblem problem = new MathProblem();

                column    = problemIndex % 5;
                row       = problemIndex / 5;
                xPosition = 1 + (problem.Width * column);
                yPosition = 1 + (problem.Height * row);

                problem.Location = new System.Drawing.Point(xoffset + xPosition, yoffset + yPosition);
                problem.Name     = "mathProblem" + problemIndex;
                problem.Size     = new System.Drawing.Size(200, 185);
                problem.TabIndex = 13;

                problem.CreateProblem(TypeOfMath, HighestNumber);
                problem.ProblemComplete += MathProblem1_ProblemComplete;

                Controls.Add(problem);
                problemList.Add(problem);
            }
        }
Exemplo n.º 2
0
 private void PlaySoundIfNewlyCorrect(MathProblem sender)
 {
     if ((sender.Enabled) && (sender.SolutionIsCorrect))
     {
         EmitBell();
     }
 }