I am a user of c#, visual studio 2005.
I have a principal MDI Master Form that launch mdi childrens. I need to access from one of this childs to a method in Master Form.
How can I do this?
Must I use delegates?
Static methods? (if static, my problem is that I can call Master's method from child but this method isn't able to accessing form controls.)
Loading
Jan MontanoPosted Oct 10, 2007, 10:17 PM
You could use Application.OpenForms[]
In the example below I have 2 Forms. One Mdiform (Form1) and one child.(Form2) And I created a public non-static method Form1.Test1() just for test purposes.
Form2.cs
private void button1_Click(object sender, EventArgs e)
{
Form1 form1 = (Form1)Application.OpenForms[0];
form1.Test1();
}