private void UCMenuMaintenance_Load(object sender, EventArgs e) { menu = ((formMenu)this.ParentForm); menu.FormClosing += new FormClosingEventHandler(menu_FormClosing); backColor1 = Color.Teal; backColor2 = Color.LightSeaGreen; hover = Color.LightCoral; selected = Color.Firebrick; }
public void showMenu(UserControl uc, int x, int y) { formMenu menu = new formMenu(uc); menu.Location = new Point(x, y); menu.Show(); menu.FormClosing += Menu_FormClosing; menu.Focus(); }
private void tabPatient_Click(object sender, EventArgs e) { try { resetColor(sender); formMenu menu = ((formMenu)this.ParentForm); menu.deact = false; UCMenuPatient uc = new UCMenuPatient(mainForm, menu); mainForm.showMenu(uc, ParentForm.Location.X + ParentForm.Width, ParentForm.Location.Y + this.tabPatient.Location.Y); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public UCMenuItems(MainForm mainForm, formMenu menu) { InitializeComponent(); this.mainForm = mainForm; this.menu = menu; }