private void btn_Click(object sender, EventArgs e) { Button btn = sender as Button; int category = Convert.ToInt32(btn.Name.Substring(3, 1)) - 1; int question = Convert.ToInt32(btn.Name.Substring(5, 1)) - 1; Question q = game.getQuestion(category, question); using (var form = new QuestionWindow(q.AnswerType(), q.GetContent(), q.GetQuestion(), (question + 1) * 100, category)) { form.ShowDialog(this); } doFinishingStuff(); }
private void btn_Click(object sender, EventArgs e) { Button btn = sender as Button; int category = Convert.ToInt32(btn.Name.Substring(3, 1)) - 1; int question = Convert.ToInt32(btn.Name.Substring(5, 1)) - 1; Question q = game.getQuestion(category, question); using (var form = new QuestionWindow(q.AnswerType(), q.GetContent(), q.GetQuestion(), (question+1)*100, category)) { form.ShowDialog(this); } doFinishingStuff(); }