0
Directly accessing the controls of another form is not object-oriented.
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.
0
You can freely access contents of another form, but off course you should not manipulate contained controls directly. Rather, create a public method on the form, e.g. like this:
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