Results 1 to 3 of 3

Thread: Drag n Drop

  1. #1

    Thread Starter
    Fanatic Member scr0p's Avatar
    Join Date
    Oct 2002
    Location
    VA
    Posts
    720

    Drag n Drop

    I have picture1, I want the user to be able to move it and drop it on any window, if the window is active or not, Anyway, when the user lets go of the picture1 I want label1 to hold the X and Y of the point the user dropped at to process. How would I do this? right now I have automatic DragMode and this code

    VB Code:
    1. Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
    2.     Label1.Caption = "X " & X & " Y " & Y
    3. End Sub
    asdf

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Since you are dragging Picture1 you wont get the Picture1_DragDrop event (unless you drop Picture1 onto Picture1). This event is for the target control.

    You would need to capture the DragDrop event for all controls where Picture1 could be dropped.

  3. #3

    Thread Starter
    Fanatic Member scr0p's Avatar
    Join Date
    Oct 2002
    Location
    VA
    Posts
    720
    What about if I want picture1 dropped outside VB? How would I capture where the user puts it? I am trying to make an API spy, where the user can drop a little box on any window and it shows the hWnd, caption and style of the window.
    asdf

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