TilakGopi
Hi Karthik,
Good solution!,
But i wanna let u know one more.., u tell me ,which is better,after understanding my code.
Have a private variable of parent form variable in child form.Modify child form's constructor or have set property for this variable.Set it either by child class constructor or property,when u instantiate the child class object.Now u can use this parent form variable , how ever u want.
It is illustrated as follows
=========================================================
[Code language = C#]
class ParentForm:Form
{
...
};
class ChildForm:Form
{
private ParentForm frmParent;
public ChildForm(ParentForm refParentForm)
{
frmParent = refParentForm;
}
.....
}
Now u can modify the ur code as follows
Form1 form1 = new Form1(this); // form1 is my child form.
form1.Show();
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
frmParent.Close();
}
[/Code]
============================================================
Thanx,
Ch.T.Gopi Kumar.