Hi,
You can do that in following way
1. show the child window and while showing child, set the owner property of child form object to the parent form as shown following
private void btnShowChild_Click(object sender, EventArgs e)
{
ChildForm ch = new ChildForm();
ch.Owner = this;
ch.ShowDialog();
}
2. In childForm, get the reference to Parent form (which was earlier set as owner of the childForm ) as shown here
ParentForm p = (ParentForm)this.Owner;
3. Once you have the reference to parent form object instance from child form, you get any control(say a button named "button2" in parentForm) using following way
private void btnDisableParentButton_Click(object sender, EventArgs e)
{
ParentForm p = (ParentForm)this.Owner;
Control[] c = p.Controls.Find("button2", true);
Button b = (Button)c[0];
b.Enabled = false;
}
NB: I am disabling a button named "button2" in Parent form from a child window.
Please let me know if that was usefull to you.
Thanks
Arindam D Tewary