Ok, it's easy to access a method or property of a mdichild form from the parent form but I'm not able to do the same in the other way.
For example, if I want to set the text property of the status bar of a mdiparent form, I can have this :
public class mdiParentForm : System.Windows.Forms.Form
{
...
public void SetStatusBar(string str)
{
statusbar1.Text = str;
}
}
And the following code from the mdichild form :
public class mdiChildForm : System.Windows.Forms.Form
{
...
public void SomeFunction()
{
this.mdiParent.SetStatusBar("Hello World");
}
}
This last code doesn't work because I can't access the SetStatusBar function from the mdichild.
You can not access properties (or methods) of parent
through MDIParent unless you cast MDIParent to class
of your parent. MDIParent is Form and it doesn't have all
the methods (properties) of its subclasses.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.