private void loadQuizes() { foreach (Quiz quiz in QuizHandler.getQuizes()) { QuizObject panelitem = new QuizObject(quiz); panelitem.title.Text = quiz.title; panelitem.questions.Text = "" + quiz.amount_questions; this.flowLayoutPanel1.Controls.Add(panelitem); } }
public static void loadQuiz(String file) { Quiz quiz = new Quiz(file); if (quiz.loadQuestions()) { quizes.Add(quiz); QuizObject quizobject = new QuizObject(quiz); quizobject.title.Text = quiz.title; quizobject.questions.Text = "" + quiz.questionsets.Count; Form1.main.flowLayoutPanel1.Controls.Add(quizobject); } else { MessageBox.Show("An error occured while parsing the quiz."); } }