Ejemplo n.º 1
0
 private void generate()
 {
     timeLabel.Foreground = Brushes.Black;
     x = rnd.Next(100, 501);
     y = rnd.Next(100, 501);
     dollarsLabel.Content = dollars + "$";
     problem.Content      = x + " + " + y + " = ?";
     t.Stop();
     t.Start();
     AnswerBox.Focus();
     time = 0;
     timeLabel.Content = "   00 : " + time.ToString("00");
 }
Ejemplo n.º 2
0
 private void displayNextProblem()
 {
     //get the next problem
     _CurrentProblem = ProblemFactory.GetArithmeticProblem <int>(getNextOperation(), 2, 20, false);
     string[] lines = _CurrentProblem.Display().ToArray();
     if (lines.Length > 0)
     {
         lines[0] = lines.First().Remove(0, 1);                   //remove the first symbol
     }
     ProblemBox.Lines = lines;
     AnswerBox.Text   = string.Empty;
     AnswerBox.Focus();
     _Timer.Restart();
 }
Ejemplo n.º 3
0
        public AssessmentFillUpsView()
        {
            InitializeComponent();

            Xamarin.Forms.Device.BeginInvokeOnMainThread(() => {
                Task.Delay(1000);
            });


            AnswerBox.Completed += (object sender, EventArgs e) => {
                if (!string.IsNullOrEmpty(AnswerBox.Text) && !string.IsNullOrWhiteSpace(AnswerBox.Text))
                {
                    this.Answer = AnswerBox.Text;
                    AnswerBox.Focus();
                    AnswerBox.Unfocus();
                }
            };
        }
Ejemplo n.º 4
0
 private void Window_ContentRendered(object sender, EventArgs e)
 {
     AnswerBox.SelectAll();
     AnswerBox.Focus();
 }
Ejemplo n.º 5
0
 protected override void OnActivated(EventArgs e)
 {
     base.OnActivated(e);
     AnswerBox.Focus();
 }