From 81133e9be8ba16a50240c7b443cbdd41359e9358 Mon Sep 17 00:00:00 2001 From: Adam McCane Date: Fri, 9 Feb 2024 13:35:42 -0500 Subject: [PATCH] Added code to all of the mnuWindow items to have window functionality. --- .../frmMain.Designer.cs | 15 ++++++--- Louis'-Pharmacy_CNSA212-FP/frmMain.cs | 32 ++++++++++++++++++- .../frmRefill.Designer.cs | 1 + Louis'-Pharmacy_CNSA212-FP/frmRefill.cs | 2 +- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Louis'-Pharmacy_CNSA212-FP/frmMain.Designer.cs b/Louis'-Pharmacy_CNSA212-FP/frmMain.Designer.cs index 94bf4b7..fdf3e97 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmMain.Designer.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmMain.Designer.cs @@ -111,32 +111,37 @@ // mnuWindowArrangeIcons // this.mnuWindowArrangeIcons.Name = "mnuWindowArrangeIcons"; - this.mnuWindowArrangeIcons.Size = new System.Drawing.Size(147, 22); + this.mnuWindowArrangeIcons.Size = new System.Drawing.Size(180, 22); this.mnuWindowArrangeIcons.Text = "Arrange Icons"; + this.mnuWindowArrangeIcons.Click += new System.EventHandler(this.mnuWindowArrangeIcons_Click); // // mnuWindowCascade // this.mnuWindowCascade.Name = "mnuWindowCascade"; - this.mnuWindowCascade.Size = new System.Drawing.Size(147, 22); + this.mnuWindowCascade.Size = new System.Drawing.Size(180, 22); this.mnuWindowCascade.Text = "Cascade"; + this.mnuWindowCascade.Click += new System.EventHandler(this.mnuWindowCascade_Click); // // mnuWindowHorizontal // this.mnuWindowHorizontal.Name = "mnuWindowHorizontal"; - this.mnuWindowHorizontal.Size = new System.Drawing.Size(147, 22); + this.mnuWindowHorizontal.Size = new System.Drawing.Size(180, 22); this.mnuWindowHorizontal.Text = "Horizontal"; + this.mnuWindowHorizontal.Click += new System.EventHandler(this.mnuWindowHorizontal_Click); // // mnuWindowVertical // this.mnuWindowVertical.Name = "mnuWindowVertical"; - this.mnuWindowVertical.Size = new System.Drawing.Size(147, 22); + this.mnuWindowVertical.Size = new System.Drawing.Size(180, 22); this.mnuWindowVertical.Text = "Vertical"; + this.mnuWindowVertical.Click += new System.EventHandler(this.mnuWindowVertical_Click); // // mnuWindowCloseAll // this.mnuWindowCloseAll.Name = "mnuWindowCloseAll"; - this.mnuWindowCloseAll.Size = new System.Drawing.Size(147, 22); + this.mnuWindowCloseAll.Size = new System.Drawing.Size(180, 22); this.mnuWindowCloseAll.Text = "Close All"; + this.mnuWindowCloseAll.Click += new System.EventHandler(this.mnuWindowCloseAll_Click); // // mnuHelp // diff --git a/Louis'-Pharmacy_CNSA212-FP/frmMain.cs b/Louis'-Pharmacy_CNSA212-FP/frmMain.cs index 7205b2d..477991d 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmMain.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmMain.cs @@ -29,6 +29,8 @@ namespace Louis__Pharmacy_CNSA212_FP private void mnuNavigationView_Click(object sender, EventArgs e) { + mnuNavigationView.Checked = true; + frmInfo formInfo = new frmInfo(); formInfo.MdiParent = this; @@ -36,7 +38,7 @@ namespace Louis__Pharmacy_CNSA212_FP formInfo.Show(); formInfo.Focus(); - mnuNavigationView.Checked = true; + } private void mnuNavigationAUPaPh_Click(object sender, EventArgs e) @@ -74,5 +76,33 @@ namespace Louis__Pharmacy_CNSA212_FP mnuNavigationAURRefill.Checked = true; } + + private void mnuWindowArrangeIcons_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.ArrangeIcons); + } + + private void mnuWindowCascade_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.Cascade); + } + + private void mnuWindowHorizontal_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.TileHorizontal); + } + + private void mnuWindowVertical_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.TileVertical); + } + + private void mnuWindowCloseAll_Click(object sender, EventArgs e) + { + foreach (Form childform in this.MdiChildren) + { + childform.Close(); + } + } } } diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs index 9e76a09..dce9e40 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs @@ -436,6 +436,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.Margin = new System.Windows.Forms.Padding(2); this.Name = "frmRefill"; this.Text = "Louis\' Pharmacy - Prescription Refill"; + this.Deactivate += new System.EventHandler(this.frmRefill_Deactivate); this.Load += new System.EventHandler(this.frmRefill_Load); this.tabControl1.ResumeLayout(false); this.tbAddRefill.ResumeLayout(false); diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs index dfcb6e3..f9d0f5a 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs @@ -28,7 +28,7 @@ namespace Louis__Pharmacy_CNSA212_FP private void frmRefill_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'finalProjectOfficialPharmacyDataSet.REFILLS' table. You can move, or remove it, as needed. - this.rEFILLSTableAdapter.Fill(this.finalProjectOfficialPharmacyDataSet.REFILLS); + //this.rEFILLSTableAdapter.Fill(this.finalProjectOfficialPharmacyDataSet.REFILLS); } }