public void Open(object caller, string who) { switch (who) { case "lecture": var calling = new LecturesPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this) { Anchor = AnchorStyles.Top | AnchorStyles.Bottom }; calling.Size = this.Size; this.Controls.Add(calling); calling.BringToFront(); break; case "section": var calling1 = new SectionsPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this) { Anchor = AnchorStyles.Top | AnchorStyles.Bottom }; calling1.Size = this.Size; this.Controls.Add(calling1); calling1.BringToFront(); break; case "book": var calling2 = new BooksPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this) { Anchor = AnchorStyles.Top | AnchorStyles.Bottom }; calling2.Size = this.Size; this.Controls.Add(calling2); calling2.BringToFront(); break; case "instructor": var calling3 = new InstructorPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this) { Anchor = AnchorStyles.Top | AnchorStyles.Bottom }; calling3.Size = this.Size; this.Controls.Add(calling3); calling3.BringToFront(); break; case "material": var calling4 = new MaterialPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this) { Anchor = AnchorStyles.Top | AnchorStyles.Bottom }; calling4.Size = this.Size; this.Controls.Add(calling4); calling4.BringToFront(); break; } }
private void Materialbtn_Click(object sender, EventArgs e) { newmaterialpanel._update(); newmaterialpanel.BringToFront(); }