Kishore
There are many ways you can do this. If you are using MDI forms you can use the ParentForm property which returns a form object:
this.ParentForm;
If you are not using MDI forms you may want to pass the form through a constructor to the newly created form:
public class MainForm : System.Windows.Forms.Form {
//variables
MyForm formX;
//code ..., contructors and such
public void OpenNewForm() {
formX = new MyForm(this);
}
}
public class MyForm : System.Windows.Forms.Form {
MainForm masterForm;
public MyForm(Form form) {
masterForm = (MainForm) form;
}
}
Hope this helps.
Eric Maino
GVSU Microsoft SA