How to create a "No entry zone" for a drag and drop operation?

I’m trying to make it so, when dragging an image, if the mouse goes past the edge of the screen, the player will not be able to continue dragging. Any help?