2 - Rename Form1 is MainForm
3 - Change IsMdiContainer property of MainForm is true
4 - Add MenuStrip name is File
5 - SubMenus of File are New, Close, CloseAll
6 - Add MenuStrip name is Window
7 - SubMenus of Window are Cascade, Horizontal, Verital
8 - Add New Windows Form name is MdiChild
9 - Create LoginForm in MdiChild with 2 TextBox are txtUserName, txtPassword; 2 Button are btnLogin, btnCancel
10 - Code for btnLogin_Click() is:
((MainForm)this.MdiParent).enableControl();
11 - Code for New_Click() is:
MdiChild frmChil = new MdiChild();
frmChil.MdiParent = this;
frmChil.Show();
12 - Code for Close_Click() is:
if (this.ActiveMdiChild != null)
this.ActiveMdiChild.Close();
13 - Code for CloseAll_Click is:
int iLength = MdiChildren.Length;
for (int i = 0; i < iLength; i++)
{
MdiChildren[0].Dispose();
}
14 - Code for Cascade_Click() is:
this.LayoutMdi(MdiLayout.Cascade);
15 - Code for Horizontal_Click() is:
this.LayoutMdi(MdiLayout.TileHorizontal);
16 - Code for Verital_Click() is:
this.LayoutMdi(MdiLayout.TileVertical);
17 - Code for public void enableControl()
{
//Write this code in MainForm
}
18 - Run
No comments:
Post a Comment