Represents a form (collection of Control objects) to be used for display in a project.
This class should not be directly inherited, as it is infrastructure for other, more graphics related, projects. You should, instead, inherit a form that is shipped with the related Graphics Library extension for your project. I spent a lot of time typing out this class. I just started typing and typing, and I didn't stop typing.
Inheritance: ContainerControl
Beispiel #1
0
        /// <summary>
        /// Removes an owned form from this form.
        /// </summary>
        /// <param name="ownedForm">A <see cref="Form"/> representing the form to remove from the list of owned forms for this form.</param>
        /// <remarks>
        /// https://msdn.microsoft.com/en-us/library/system.windows.forms.form.removeownedform(v=vs.110).aspx
        /// </remarks>
        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;
        }
Beispiel #2
0
        /// <summary>
        /// Adds an owned form to this form.
        /// </summary>
        /// <param name="ownedForm">The <see cref="Form"/> that this form will own.</param>
        /// <remarks>
        /// https://msdn.microsoft.com/en-us/library/system.windows.forms.form.addownedform(v=vs.110).aspx
        /// </remarks>
        public void AddOwnedForm(Form ownedForm)
        {
            Form[] tForms = new Form[OwnedForms.Length + 1];

            for (int i = 0; i < OwnedForms.Length; i++)
            {
                tForms[i] = OwnedForms[i];
            }

            tForms[tForms.Length - 1] = ownedForm;
            OwnedForms = tForms;
        }