Here is how:
myForm.Owner = someOtherForm;
You can also use
System.Windows.Forms.Form.AddOwnedForm
. Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.owner.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.addownedform.aspx[
^].
For application consistency, it's very important to make all forms owned by other forms, except them main form; it's usually the best to have all forms owned by the main one. It's is only important that all ownership leads to the main form. If you don't do it, all forms would behave like that of independent application: a window of any different application may appear between the forms of your application in Z-order, which is not nice.
For the similar reason, it's good to assign the property
ShowInTaskbar
to false for all forms except the main one:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.showintaskbar.aspx[
^].
—SA