Evbpc.Framework.Windows.Forms.Form.RemoveOwnedForm C# (CSharp) Method

RemoveOwnedForm() public method

Removes an owned form from this form.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.removeownedform(v=vs.110).aspx
public RemoveOwnedForm ( Form ownedForm ) : void
ownedForm Form A representing the form to remove from the list of owned forms for this form.
return void
        public void RemoveOwnedForm(Form ownedForm)
        {
            Form[] tForms = new Form[OwnedForms.Length - 1];

            int tIndex = 0;

            foreach (Form f in OwnedForms)
            {
                if (!f.Equals(ownedForm))
                {
                    tForms[tIndex] = f;
                    tIndex++;
                }
            }

            OwnedForms = tForms;
        }