using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WinFormTest
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void btnSubFormControler_Click(object sender, EventArgs e)
{
if (this.OwnedForms.Count() == 0)
this.AddOwnedForm(new SubForm());
this.OwnedForms[0].Visible = !this.OwnedForms[0].Visible;
}
private void frmMain_Load(object sender, EventArgs e)
{
this.AddOwnedForm(new SubForm());
}
}
}