class Form1: Form
{
public void showNewDialog()
{
Form2 = new Form2();
diagForm.showDialog(this);
diagForm.Dispose();
}
}
In the above code the Owner property of diagForm is set to NULL. How to set its Owner property to Form1 instance ?
You can set the owner this way :
If you check the Owner in the diagForm constructor it will be null, but if you check it in the onLoad event it will be form1