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"); }
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(); }
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(); } }; }
private void Window_ContentRendered(object sender, EventArgs e) { AnswerBox.SelectAll(); AnswerBox.Focus(); }
protected override void OnActivated(EventArgs e) { base.OnActivated(e); AnswerBox.Focus(); }