Widgets off screen

Is there any way to make not possible to drag widget off screen and leave it there? The perfect thing would be if the widget hits screen border and stay there till dragged in some other direction.

i wanna know this too ! how can i stop widgets from being dragged out of the screen ?

Sure if you drop it compare it against Screenbounds and if its outside you move it into Screenspace again. Doing this On Mouse move works too but is a bit Harder to setup. The Calculations themself are a bit tricky too since you have to take Anchor points, Scale and DPI and potantialy other Factors into consideration. Work your way up step by step and check your Numbers often if the match up with what you expect. Also change your Screensize often so you see DPI changes too.

Good Luck mate =)

Ty for fast reply.
well this is exactly what i have , but doing it this way , i can drag it out of the screen , just cant drop it there .

Isnt there some mysterious function in drag and drop class to limit mouse to screen or something like that ?

Sry there is no Build in one Im aware of. You have to manually keep it in place. You can even create your own UDragDropOperation if needed. The thing you simply want to achive in addition of what you got is to perform the bounds check on every mouse move.