public void DockTo(DockingHostToolStripPanel panel)
        {
            if (!IsFloating)
            {
                return;
            }

            if ((panel == null) || (Parent is ToolStripPanel))
            {
                return;
            }

            isFloating = false;

            KryptonFloatingForm kryptonFloatingForm = (KryptonFloatingForm)Parent;

            kryptonFloatingForm.Hide();

            Stretch = false;

            GripStyle = ToolStripGripStyle.Hidden;

            kryptonFloatingForm.Controls.Remove(this);

            panel.Controls.Add(this);

            kryptonFloatingForm.Close();
        }
        public TearOffToolStrip()
        {
            topToolStripPanel = null;

            bottomToolStripPanel = null;

            leftToolStripPanel = null;

            rightToolStripPanel = null;

            lastDockedPanel = null;

            isFloating = false;

            disableMouseCapture = false;

            InitializeComponent();
        }
        public void MakeFloating()
        {
            DockingHostToolStripPanel parentPanel = new DockingHostToolStripPanel();

            if (parentPanel == null)
            {
                return;
            }

            disableMouseCapture = true;

            isFloating = true;

            Orientation orientation = Orientation;

            KryptonFloatingForm kryptonFloatingForm = new KryptonFloatingForm();

            kryptonFloatingForm.Text = Text;

            kryptonFloatingForm.Bounds = new Rectangle(MousePosition, Size);

            kryptonFloatingForm.Location = new Point(MousePosition.X + 25, MousePosition.Y + 25);

            lastDockedPanel = parentPanel;

            parentPanel.Controls.Remove(this);

            kryptonFloatingForm.Controls.Add(this);

            Stretch = true;

            Dock = DockStyle.Fill;

            GripStyle = ToolStripGripStyle.Hidden;

            kryptonFloatingForm.MouseCaptureChanged += new EventHandler(KryptonFloatingForm_MouseCaptureChanged);

            kryptonFloatingForm.DockingRequested += new EventHandler(KryptonFloatingForm_DockingRequested);

            kryptonFloatingForm.Show(parentPanel.Parent);
        }