|
-
Feb 13th, 2009, 03:50 PM
#1
Thread Starter
Member
Drag & Drop Outside Form?
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.
-
Feb 13th, 2009, 04:14 PM
#2
Re: Drag & Drop Outside Form?
Drop it where? On another form in your project?
-
Feb 14th, 2009, 02:14 PM
#3
Thread Starter
Member
Re: Drag & Drop Outside Form?
No. Not another form and not project. just drop it outside the window.
-
Feb 14th, 2009, 02:19 PM
#4
Re: Drag & Drop Outside Form?
Can you explain in more detail? Drag what exactly (text, image, file, control)? Dragging from your app? Dropping where exactly?
-
Feb 15th, 2009, 07:55 AM
#5
Thread Starter
Member
Re: Drag & Drop Outside Form?
Drag ANYTHING, but currently I need to drag a label. Look at this:
-
Feb 15th, 2009, 10:42 AM
#6
Re: Drag & Drop Outside Form?
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|