void ctrl_OnExitControlEvent(Xtra_UC_Base sender, PanelControl panel)
 {
     if (panel.Contains(sender))
     {
         RemoveControlFromPannel((Xtra_UC_Base)sender);
     }
 }
        public void RemoveControlFromPannel(Xtra_UC_Base ctrl)
        {
            PanelControl panel = ctrl.ParentPanel;

            if (ctrl != null)
            {
                ctrl.Exit();
                if (panel.Contains(ctrl))
                {
                    panel.Controls.Remove(ctrl);
                    controls.Remove(ctrl.Key);

                    if (panel.Controls.Count != 0)
                    {
                        using (WaitCursorHelper w = new WaitCursorHelper(ParentForm))
                        {
                            ctrl = (Xtra_UC_Base)ctrl.ParentPanel.Controls[0];
                            ctrl.Refresh();
                        }
                    }
                }
            }
        }
 void ctrl_OnExitControlEvent(Xtra_UC_Base sender, PanelControl panel)
 {
     if (panel.Contains(sender))
     {
         RemoveControlFromPannel((Xtra_UC_Base)sender);
     }
 }