Docking bar problem

Hi i have a problem when i dock a control in to a panel the
problem is when i dock the control a litle bar appear in the top
of the control with a litle x button the dock and undock
procedures are ok but when i try to move the docked control
(drag the litle title with the x button ) the program rize an
exeption saying EInvalid Operation with message 'can't focus a
disabled or invisible window' what is happening