Results 1 to 6 of 6

Thread: Drag & Drop Outside Form?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Drag & Drop Outside Form?

    Drop it where? On another form in your project?

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Re: Drag & Drop Outside Form?

    No. Not another form and not project. just drop it outside the window.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Re: Drag & Drop Outside Form?

    Drag ANYTHING, but currently I need to drag a label. Look at this:

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width