Пример #1
0
        private void OpenEkstreForm()
        {
            EkstreForm ekstreForm = new EkstreForm();

            ekstreForm.MdiParent       = this;
            ekstreForm.Dock            = DockStyle.Fill;
            ekstreForm.TopLevel        = false;
            ekstreForm.FormBorderStyle = FormBorderStyle.None;
            ekstreForm.Show();

            TabPage tp = new TabPage(this.ActiveMdiChild.Text)
            {
                Tag    = this.ActiveMdiChild,
                Parent = tabForms
            };

            tabForms.SelectedTab = tp;

            this.ActiveMdiChild.Tag         = tp;
            this.ActiveMdiChild.FormClosed += new FormClosedEventHandler(ActiveMdiChild_FormClosed);
            tp.Controls.Add(ekstreForm);

            if (!tabForms.Visible)
            {
                tabForms.Visible = true;
            }
        }