private void Pic_Click(object sender, EventArgs e) { PictureBox p = sender as PictureBox; int PicID = Convert.ToInt32(p.Name); //to do frmMain.MainPanel.Controls.Clear(); AdminUserDetailForm userDetailAdminForm = new AdminUserDetailForm(frmMain, PicID); userDetailAdminForm.TopLevel = false; userDetailAdminForm.Dock = DockStyle.Fill; frmMain.MainPanel.Controls.Add(userDetailAdminForm); userDetailAdminForm.Show(); }
private void Label_Click(object sender, EventArgs e) { Control c = sender as Control; string LabName = c.Name.Substring(1); int LabID = Convert.ToInt32(LabName); frmMain.MainPanel.Controls.Clear(); AdminUserDetailForm userDetailAdminForm = new AdminUserDetailForm(frmMain, LabID); userDetailAdminForm.TopLevel = false; userDetailAdminForm.Dock = DockStyle.Fill; frmMain.MainPanel.Controls.Add(userDetailAdminForm); userDetailAdminForm.Show(); }
private void ReturnButton_Click(object sender, EventArgs e) { int v = (int)ReturnButton.Tag; if (v == 1) { ClassBackEnd.ClearBookList(); MainPanel.Controls.Clear(); AdminFunctionForm adminFunctionForm = new AdminFunctionForm(this); adminFunctionForm.TopLevel = false; adminFunctionForm.Dock = DockStyle.Fill; MainPanel.Controls.Add(adminFunctionForm); adminFunctionForm.Show(); } else if (v == 2) { MainPanel.Controls.Clear(); AdminBookManageForm bookManageForm = new AdminBookManageForm(this); bookManageForm.TopLevel = false; bookManageForm.Dock = DockStyle.Fill; MainPanel.Controls.Add(bookManageForm); bookManageForm.Show(); } else if (v == 3) { MainPanel.Controls.Clear(); AdminUserManageForm userManageForm = new AdminUserManageForm(this); userManageForm.TopLevel = false; userManageForm.Dock = DockStyle.Fill; MainPanel.Controls.Add(userManageForm); userManageForm.Show(); } else if (v == 4) { MainPanel.Controls.Clear(); AdminUserDetailForm userDetailAdminForm = new AdminUserDetailForm(this, AdminUserDetailForm.UserIndex); userDetailAdminForm.TopLevel = false; userDetailAdminForm.Dock = DockStyle.Fill; MainPanel.Controls.Add(userDetailAdminForm); userDetailAdminForm.Show(); } }