Files
Mapo-IOB-WIN/IOB-WIN/MainForm.cs
T
2017-12-19 16:06:27 +01:00

53 lines
1003 B
C#

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 MainForm : Form
{
public MainForm()
{
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();
}
}
}