Here is the Parent Form, You will notice that our Color bgColor is an internal method as well as our FormHook. with the FormHook we will be able to call any internal or public method in this Form from any Form in our project.
public partial class Form1 : Form
{
internal static Form1 FormHook;
internal Color bgColor
{
get { return this.BackColor; }
set {this.BackColor = value;}
}
public Form1()
{
InitializeComponent();
FormHook = this;
Form2 form = new Form2();
form.Show();
}
}
To call this method you could just call as
Form1.FormHook.bgColor = Color.Black;
If You want to use dynamic method it could be done as such
public partial class Form1 : Form
{
internal static dynamic FormHook;
internal Color bgColor
{
get { return this.BackColor; }
set {this.BackColor = value;}
}
public Form1()
{
InitializeComponent();
FormHook = this;
Form2 form = new Form2();
form.Show();
}
}
Would still be called the same way Form1.FormHook.bgColor = Color.Black;