private void CasesButton_Click(object sender, EventArgs e) { ActivateButton(sender, RGBColors.color3); CurrentChildForm?.Close(); CasesSubMenuePanel.Visible = true; PictureBox.Visible = true; }
private void OpenChildForm(Form ChildForm) { // For Each Sub_Panel Buttons you need to add Tag of respected Form if ((CurrentChildForm == null) || (CurrentChildForm.Tag != ChildForm.Tag) || ((string)CurrentChildForm.Tag == "Cases") || ((string)CurrentChildForm.Tag == "Teams")) { // Open only form CurrentChildForm?.Close(); CurrentChildForm = ChildForm; // End ChildForm.TopLevel = false; ChildForm.FormBorderStyle = FormBorderStyle.None; ChildForm.Dock = DockStyle.Fill; SubDeskTopPanel.Controls.Add(ChildForm); SubDeskTopPanel.Tag = ChildForm; ChildForm.BringToFront(); ChildForm.Show(); } }
private void LogoBox_Click(object sender, EventArgs e) { Reset(); CurrentChildForm?.Hide(); // ? to check the null reference }