diff --git a/IOB-WIN/AdapterForm.Designer.cs b/IOB-WIN/AdapterForm.Designer.cs index a9c4890b..c0c62229 100644 --- a/IOB-WIN/AdapterForm.Designer.cs +++ b/IOB-WIN/AdapterForm.Designer.cs @@ -587,7 +587,7 @@ // this.displTimer.Tick += new System.EventHandler(this.displTimer_Tick); // - // MainForm + // AdapterForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; @@ -599,7 +599,7 @@ this.Controls.Add(this.statusStrip1); this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; - this.Name = "MainForm"; + this.Name = "AdapterForm"; this.Text = "IOB-WIN"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.Shown += new System.EventHandler(this.MainForm_Shown); diff --git a/IOB-WIN/IOB-WIN.csproj b/IOB-WIN/IOB-WIN.csproj index e4b71b64..337c4015 100644 --- a/IOB-WIN/IOB-WIN.csproj +++ b/IOB-WIN/IOB-WIN.csproj @@ -93,6 +93,12 @@ + + Form + + + TestForm.cs + diff --git a/IOB-WIN/MainForm.Designer.cs b/IOB-WIN/MainForm.Designer.cs index 85db6c9f..578776fd 100644 --- a/IOB-WIN/MainForm.Designer.cs +++ b/IOB-WIN/MainForm.Designer.cs @@ -30,7 +30,12 @@ { this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.windowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openChildToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeChildToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // statusStrip1 @@ -45,37 +50,64 @@ // menuStrip1 // this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.openChildToolStripMenuItem, + this.closeChildToolStripMenuItem, + this.windowToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1048, 24); + this.menuStrip1.Size = new System.Drawing.Size(1048, 28); this.menuStrip1.TabIndex = 2; this.menuStrip1.Text = "menuStrip1"; // - // tableLayoutPanel1 + // fileToolStripMenuItem // - this.tableLayoutPanel1.ColumnCount = 2; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 27); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1048, 100); - this.tableLayoutPanel1.TabIndex = 3; + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.checkForUpdatesToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24); + this.fileToolStripMenuItem.Text = "&File"; + // + // windowToolStripMenuItem + // + this.windowToolStripMenuItem.Name = "windowToolStripMenuItem"; + this.windowToolStripMenuItem.Size = new System.Drawing.Size(76, 24); + this.windowToolStripMenuItem.Text = "&Window"; + // + // checkForUpdatesToolStripMenuItem + // + this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; + this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(205, 26); + this.checkForUpdatesToolStripMenuItem.Text = "Check for &Updates"; + // + // openChildToolStripMenuItem + // + this.openChildToolStripMenuItem.Name = "openChildToolStripMenuItem"; + this.openChildToolStripMenuItem.Size = new System.Drawing.Size(69, 24); + this.openChildToolStripMenuItem.Text = "Child +"; + this.openChildToolStripMenuItem.Click += new System.EventHandler(this.openChildToolStripMenuItem_Click); + // + // closeChildToolStripMenuItem + // + this.closeChildToolStripMenuItem.Name = "closeChildToolStripMenuItem"; + this.closeChildToolStripMenuItem.Size = new System.Drawing.Size(65, 24); + this.closeChildToolStripMenuItem.Text = "Child -"; + this.closeChildToolStripMenuItem.Click += new System.EventHandler(this.closeChildToolStripMenuItem_Click); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1048, 807); - this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.menuStrip1); this.IsMdiContainer = true; this.MainMenuStrip = this.menuStrip1; this.Name = "MainForm"; this.Text = "IOB MANAGER"; + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -85,6 +117,10 @@ private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem windowToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openChildToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem closeChildToolStripMenuItem; } } \ No newline at end of file diff --git a/IOB-WIN/MainForm.cs b/IOB-WIN/MainForm.cs index f8258535..7e5a1438 100644 --- a/IOB-WIN/MainForm.cs +++ b/IOB-WIN/MainForm.cs @@ -16,5 +16,37 @@ namespace IOB_WIN { InitializeComponent(); } + + protected void closeActiveChild() + { + if (this.HasChildren) + { + try + { + this.ActiveMdiChild.Close(); + this.LayoutMdi(MdiLayout.TileHorizontal); + } + catch + { } + } + } + + protected void openChild() + { + TestForm child = new TestForm(); + child.MdiParent = this; + child.Show(); + this.LayoutMdi(MdiLayout.TileHorizontal); + } + + private void closeChildToolStripMenuItem_Click(object sender, EventArgs e) + { + closeActiveChild(); + } + + private void openChildToolStripMenuItem_Click(object sender, EventArgs e) + { + openChild(); + } } } diff --git a/IOB-WIN/Program.cs b/IOB-WIN/Program.cs index 549b36e1..fffacbee 100644 --- a/IOB-WIN/Program.cs +++ b/IOB-WIN/Program.cs @@ -19,7 +19,7 @@ namespace IOB_WIN { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new AdapterForm()); + Application.Run(new MainForm()); } } } diff --git a/IOB-WIN/TestForm.Designer.cs b/IOB-WIN/TestForm.Designer.cs new file mode 100644 index 00000000..070551bd --- /dev/null +++ b/IOB-WIN/TestForm.Designer.cs @@ -0,0 +1,38 @@ +namespace IOB_WIN +{ + partial class TestForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Text = "TestForm"; + } + + #endregion + } +} \ No newline at end of file diff --git a/IOB-WIN/TestForm.cs b/IOB-WIN/TestForm.cs new file mode 100644 index 00000000..d104a9df --- /dev/null +++ b/IOB-WIN/TestForm.cs @@ -0,0 +1,20 @@ +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 IOB_WIN +{ + public partial class TestForm : Form + { + public TestForm() + { + InitializeComponent(); + } + } +}