private void Inventory_Click(object sender, EventArgs e) { DrinkButton.Visible = true; FoodButton.Visible = true; Inventory.Visible = false; _obj = this; if (FoodPage.Instance.panel2.Controls.ContainsKey("UserControl3")) { panel2.Controls["UserControl3"].SendToBack(); } else { panel2.Controls["UserControl4"].SendToBack(); } UserControl8 uc = new UserControl8(); uc.Dock = DockStyle.Fill; panel2.Controls.Add(uc); panel2.Controls["UserControl8"].BringToFront(); if (FoodPage.Instance.panel3.Controls.ContainsKey("UserControl6")) { panel3.Controls["UserControl6"].SendToBack(); } else { panel3.Controls["UserControl5"].SendToBack(); } UserControl7 uc1 = new UserControl7(); uc1.Dock = DockStyle.Fill; panel3.Controls.Add(uc1); panel3.Controls["UserControl7"].BringToFront(); }
private void button2_Click(object sender, EventArgs e) { var date = DateTime.Now.ToLongDateString(); var time = DateTime.Now.ToLongTimeString(); MessageBox.Show(date, time); FoodPage myForm = new FoodPage(); this.Hide(); myForm.ShowDialog(); this.Close(); }
private void Form2_Load(object sender, EventArgs e) { FoodButton.Visible = false; _obj = this; UserControl4 uc = new UserControl4(); uc.Dock = DockStyle.Fill; panel2.Controls.Add(uc); UserControl5 uc1 = new UserControl5(); uc.Dock = DockStyle.Fill; panel3.Controls.Add(uc1); }