private void playAgainBtn_Click(object sender, EventArgs e) { Controls.Clear(); QuizPanel q = new QuizPanel(quiz); q.Dock = DockStyle.Fill; Controls.Add(q); }
private void ResultQuiz_Click(object sender, EventArgs e) { Controls.Clear(); QuizPanel p = new QuizPanel(new QuizPlayerController(((ResultQuizControl)sender).GetQuiz())); p.Dock = DockStyle.Fill; Controls.Add(p); }
private void ChangePanel(string name) { mainPanel.Controls.Clear(); switch (name) { case "createQuiz": if (Login.Login.userID != -1) { CreateQuizControl c = new CreateQuizControl(); c.Dock = DockStyle.Fill; mainPanel.Controls.Add(c); } else { GoToLoginPanel(); } break; case "categories": SearchControl d = new SearchControl { Dock = DockStyle.Fill }; mainPanel.Controls.Add(d); break; case "feelLucky": QuizPanel e = new QuizPanel(new QuizPlayerController(new QuizHandler.FeelLucky().GetARandomQuiz(10))); e.Dock = DockStyle.Fill; mainPanel.Controls.Add(e); break; case "profile": if (LoginStatusData.userID != 0) { ProfileControl f = new ProfileControl(); f.Dock = DockStyle.Fill; mainPanel.Controls.Add(f); } else { GoToLoginPanel(); } break; case "feedback": if (LoginStatusData.userID != 0) { FeedbackControl g = new FeedbackControl(); g.Dock = DockStyle.Fill; mainPanel.Controls.Add(g); } else { GoToLoginPanel(); } break; default: Console.WriteLine("No control selected"); break; } }