I am working in Desktop application in C#. I have an MDI Parent form having Panel control for adding Child Forms in it.
I have 2 childs forms:
1. ChildForm1
2. ChildForm2
Childform2 is opened from childform1.
From MDI form i add childform1 to panel control, know i want to add childform2 also to mdi Form panel control. When i click button on childform1, from mdi form panel control childform1 must be removed and childform2 will be added to mdi form panel control.
How to solve this problem?
You first open ChildForm2 from ChildForm1 by passing refrence of ChildForm1 to ChildForm2
Now Go to your ChildForm2 and Add Parametrize contructor also create Global object of ChildForm1
Now when your ChildForm2 open ,the obove parametrize constructor will call and it will hide your ChildForm1.
Also you can reopen your ChildForm1 on close of ChildForm2.Write following code for that.