Reputation: 14978
I am working on MDI app which have Child Forms. I have to show Child Window once a certain conditions is met.
I created a separate Class named clsDashbord having method loadDashboard() which is supposed to load frmDashboard already designed. Code is given below:
public void loadDashboard(String userName)
{
_Dashboard = new frmDashboard();
_Main = new frmMDI();
// _Dashboard.MdiParent = _Main;
_Dashboard.Text = userName;
_Dashboard.Show();
}
Form does not show up if I set MDIParent to Main which is instance variable of MDI Form otherwise it gets displayed. How to do it?
Upvotes: 1
Views: 2249
Reputation: 78
It looks more like a scoping problem by looking at line '_Main = new frmMDI();'
follow these steps:
Upvotes: 2