using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Diplom_B { public partial class DogForm : Form { public int? returnId = null; private bool needReturn = false; public DogForm(bool needReturn = false) { this.needReturn = needReturn; InitializeComponent(); } private void MenuItem_Click(object sender, EventArgs e) { object form = null; if ((ToolStripMenuItem)sender == mainMenuStrip.Items[0]) { form = new DogForm(); } if ((ToolStripMenuItem)sender == mainMenuStrip.Items[1]) { form = new DocForm(); } if ((ToolStripMenuItem)sender == mainMenuStrip.Items[2]) { form = new IzvForm(); } if ((ToolStripMenuItem)sender == mainMenuStrip.Items[3]) { form = new PostForm(); } if ((ToolStripMenuItem)sender == mainMenuStrip.Items[4]) { form = new IzdForm(); } if ((ToolStripMenuItem)sender == mainMenuStrip.Items[5]) { form = new ZakForm(); } if ((ToolStripMenuItem)sender == mainMenuStrip.Items[6]) { form = new SetForm(); } if (form != null) { this.Hide(); ((Form)form).Closed += (s, args) => this.Close(); ((Form)form).Show(); } } } }