Results 1 to 2 of 2

Thread: Image Drag

  1. #1

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668

    Image Drag

    How can I drag an image over another, so it just kind of "gives" it's picture to the one it's dragged on (and then it comes back to it's original position, but with nothing in it, since it gave the picture that was in it to the other one)... I don't know if you get what I'm saying....
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  2. #2
    Fanatic Member daydee's Avatar
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    560

    Re: Image Drag

    Originally posted by Alien_poo
    How can I drag an image over another, so it just kind of "gives" it's picture to the one it's dragged on (and then it comes back to it's original position, but with nothing in it, since it gave the picture that was in it to the other one)... I don't know if you get what I'm saying....
    I think I do...
    Stick 3 PictureBox on your form and load an image inside pic 2 and 3.
    Drag picturbox2 or picturebox3 over picturebox1 and it should do what you want.
    Picture 1 will be your target PictureBox in this case.
    You can also do the same with image controls.
    Hope this helps!
    VB Code:
    1. Private Sub Form_Load()
    2.   Picture2.DragMode = vbAutomatic
    3.   Picture3.DragMode = vbAutomatic
    4. End Sub
    5.  
    6. Private Sub Picture1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
    7.   If Source.Picture = 0 Then Exit Sub
    8.   Picture1.Picture = Source.Picture
    9.   Source.Picture = Nothing
    10. End Sub
    Give your music collection a whole new life with PartyTime Jukebox

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