Hi...
I am developing a woindows application.In the MDI form i have used two panels panel1 and panel 2.when the mdi form loades first panel1
gets displayed.when i display another form and i need to make visible the panel2 when a button in form1 is clicked.how can i possible this?plz help me...
Loading
Sam HobbsPosted Aug 3, 2011, 2:58 PM
MDI is designed for windows of multiple documents, not multiple windows. I don't know the details of your requiremetns, but probably a better design would be to create class that is like a document and then the forms and the rest of the application can access the objects.
Zoran HorvatPosted Aug 3, 2011, 6:32 AM
public void SetPanelVisible(bool visible)
{
panel2.Visible = visible;
}
Now on the main form you must keep reference to the child form. Use that reference in the button Click event handler:
private void button_Click(object sender, EventArgs e)
{
form2.SetPanelVisible(true);
}
Zoran