Hello. Is there a way to drag an object outside the form (without getting the cursor changed...) and drop it outside the form.
If it's not possible to drop it there, then it will help if you know how to drag it only.
Thanks.
Printable View
Hello. Is there a way to drag an object outside the form (without getting the cursor changed...) and drop it outside the form.
If it's not possible to drop it there, then it will help if you know how to drag it only.
Thanks.
Drop it where? On another form in your project?
No. Not another form and not project. just drop it outside the window.
Can you explain in more detail? Drag what exactly (text, image, file, control)? Dragging from your app? Dropping where exactly?
Drag ANYTHING, but currently I need to drag a label. Look at this:
http://i40.tinypic.com/2hdz22g.gif
You can't drag a label as is. Moving controls from one window to another requires the SetParent API. SetParent requires a window handle (i.e., hWnd). Labels are windowless controls, they do not have hWnds.
There may be work arounds. For example an API window of the class Static can be created dynamically (it has an hWnd), then that can be dragged to another window. But this is not nearly as easy as it sounds. There is much more to take into consideration.
To keep the "label" or any child control as a window instead of some drag icon, requires the window to be dislodged as a child control to one with specific window styles that will allow it to be dragged like any other window. What you are asking requires a bunch of API calls and borders on the advanced.