I have 1 MDI Form which contains 1 panel control, and 1 Form with 1 button which serves to make panel in MDI not visible.
Code in MDI Form:
public void displayInit()
{
panel1.Visible = false;
}
Code in Form1:
private void button1_Click(object sender, EventArgs e)
{
displayInit();
}
The Error is: The name 'displayInit' does not exist in the current context, Any advice please ?
Try referencing the parent (and cast it):
This probably isn't the best way to do it though. Consider having the child form raise an event to the MDI parent. Separation of concerns.