Exemplo n.º 1
0
        private void Guess(string guess)
        {
            if (TypedPanel.Visible)
            {
                InputTxt.Enabled = false;
                CheckBtn.Enabled = false;
            }
            else
            {
                foreach (Control c in MultiplePanel.Controls)
                {
                    c.TabStop = false;
                }

                foreach (Control c in MultiplePanel.Controls)
                {
                    c.Enabled = false;
                }
            }

            bool correct = questions[curID].Attempt(guess);

            if (correct)
            {
                CorrectLbl.BackColourName = "CorrectBackcolour";
                CorrectLbl.ForeColourName = "CorrectForecolour";
                CorrectLbl.Text           = "Correct!";
            }
            else
            {
                CorrectLbl.BackColourName = "IncorrectBackcolour";
                CorrectLbl.ForeColourName = "IncorrectForecolour";
                CorrectLbl.Text           = "Incorrect...";
            }

            Theme.ChangeControl(CorrectLbl);

            AnswersLbl.Text = CurrentQuestion.AnswerList();

            CorrectPanel.Height = AnswersLbl.Top + AnswersLbl.PreferredHeight + NextBtn.Height + 6;

            NextBtn.Text = (curID == questions.Length - 1) ? "Show Results" : "Next Question";

            CorrectPanel.BringToFront();
            CorrectPanel.Visible = true;

            Height = PreferredSize.Height;

            AcceptButton = NextBtn;

            NextBtn.Focus();
        }
Exemplo n.º 2
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            NextBtn.Focus();
        }