Creating MDI Application
Creating MDI Application
4 5 6 7 8 9 10 11 12
Add New Windows Form from Project Menu. Enter Form Name: frmStudent Add one label with Text : Students Info Save and Close frmStudent. Add new Windows Form from Project Menu. Enter Form Name : frmTeacher Add one Label with Text : Teachers Info Save and close frmTeacher Open Form1 click View Menu Code, enter following declarations
//create child forms and set parent st = new frmStudent(); st.MdiParent = this; t = new frmTeacher(); t.MdiParent = this;
14 Double click on Student button, add following lines:
//if no form present or visible if (st == null||!st.Visible) { //then create new one! st = new frmStudent(); st.MdiParent = this; } st.Show();
15 Double click on Teacher button, add followings:
if (t == null|| !t.Visible)
LayoutMdi(MdiLayout.Cascade);
17 Code for Tile Button:
LayoutMdi(MdiLayout.TileHorizontal);