Exemple #1
0
 private void RemoveFloatingForm()
 {
     if (_floatingForm != null)
     {
         _autoHidetoolStripButton.Visible = true;
         _tabsToolStripButton.Visible     = true;
         _floatingForm.Close();
         _floatingForm = null;
     }
 }
Exemple #2
0
        public void FloatControl(Rectangle bounds)
        {
            using (RedrawStopper redrawStopper = new RedrawStopper(_manager.ParentForm, true))
            {
                if (this.AutoHide)
                {
                    this.AutoHide = false;
                }

                DockControlContainer oldContainer = _container;
                Form parentForm = this.ParentForm;

                if (oldContainer != null)
                {
                    oldContainer.RemoveControl(this);
                }

                if (_floatingForm == null || parentForm != _floatingForm)
                {
                    _floatingForm = new FloatingForm(this, _manager);
                    _autoHidetoolStripButton.Visible = false;
                    _tabsToolStripButton.Visible     = false;
                }

                _floatingForm.Bounds = bounds;

                if (_floatingForm.Visible)
                {
                    _floatingForm.Invalidate();
                }
                else if (_floatingForm.Loaded)
                {
                    _floatingForm.Visible = !this.Cancelled;
                }
                else if (!this.Cancelled)
                {
                    _floatingForm.Show(parentForm);
                }
            }
        }