I want to make my mainform draggable like smartphone touchscreen.
So i put up a bunifugradientpanel in it and dock it in mainform. also put a bunifudragcontrol and set targetcontrol property = 'bunifugradientpanel' and vertical property to 'false' also fixed property to 'false'. however, whenever i drag my panel to the right in rumtime, the portion of the mainform is showing which is the white part in the picture.

The white part of the screen is the mainform. what i want is to stop the dragging activity if bunifugradientpanel location on mainform is = (x=0,y=0) so the the portion of the mainform wont appear. thanks for your help guys.
BunifuGradientPanelis a Third Party control and that's why it can present drawing and flickering problems, my recommendation is that you use a commonPanelSystem.Windows.Forms.PanelThat said, I created this code for you, makes a control draggable only from right to left and from left to right while the mouse button is pressed: