private void new_Student_Click(object sender, EventArgs e) { var newStudentForm = new FormStudent(); newStudentForm.ShowDialog(); if (newStudentForm.DialogResult != DialogResult.Cancel) { var workingStudent = newStudentForm.getStudent(); Resources.littleChefs.ControlStudent.newStudent(workingStudent); var enrollForm = new FormEnroll(workingStudent); enrollForm.ShowDialog(); } }
//private readonly static int STUDENT_FORM = 0; public Form1() { InitializeComponent(); comboBox1.SelectedIndex = 0; //create panel variables formPanelList = new List <Panel>(); bottomFormPanelList = new List <Panel>(); studentPanel = new FormStudent(); billingPanel = new FormBilling(); newSectionPanel = new FormSection(); studentListEntryPanel = new Form12(); //add panels to list formPanelList.Add(studentPanel.getPanel()); // 1 formPanelList.Add(billingPanel.getBillingPanel()); // 2 formPanelList.Add(newSectionPanel.getSectionPanel()); // 3 //add panels to bottom list (as default or option) bottomFormPanelList.Add(studentListEntryPanel.getStudentEntryListPanel()); //2 //add panels to form foreach (Panel p in formPanelList) { p.Location = panel1.Location; p.Size = panel1.Size; this.Controls.Add(p); } foreach (Panel p in bottomFormPanelList) { p.Location = panel2.Location; p.Size = panel2.Size; this.Controls.Add(p); } showPanelOnTop(0); showPanelOnBottom(0); }