private void initialize() { lblfun.Text = "Have fun!"; lblquestion.Text = "1 + 2"; lblanswer.Text = "Your answer:"; txtbanswer.Text = "0"; lblscore.Text = @"score: 0/0"; btnsend.Text = "Send"; lbldate.Text = DateTime.Now.ToLongDateString(); lbltime.Text = DateTime.Now.ToLongTimeString(); difficulty = new difficulty_level(level, score); level_easy(); }
private void btnsend_Click(object sender, EventArgs e) { difficulty = new difficulty_level(level, score); double sent; double.TryParse(txtbanswer.Text, out sent); if (sent == answer) { score += 1; txtbanswer.Text = "0"; } level_easy(); questions += 1; lblscore.Text = string.Format("score: {0}/{1}", score, questions); }