CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2001
    Location
    USA
    Posts
    6

    Dragging PictureBoxes

    How can I have it so the user can drag and drop picture boxes over each other?


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Dragging PictureBoxes

    for example:

    'four pictureboxes, the first to drag to
    'all with drag property set to manual
    option Explicit
    private Sub Form_DragOver(Source as Control, X as Single, Y as Single, State as Integer)

    Source.MousePointer = vbNoDrop

    End Sub
    private Sub Picture1_DragDrop(Source as Control, X as Single, Y as Single)
    Picture1.Picture = Source.Picture

    End Sub

    private Sub Picture1_DragOver(Source as Control, X as Single, Y as Single, State as Integer)
    Source.MousePointer = vbDefault
    End Sub

    private Sub Picture2_MouseDown(Button as Integer, Shift as Integer, X as Single, Y as Single)
    Picture2.Drag vbBeginDrag

    End Sub

    private Sub Picture3_MouseDown(Button as Integer, Shift as Integer, X as Single, Y as Single)
    Picture3.Drag vbBeginDrag

    End Sub
    private Sub Picture4_MouseDown(Button as Integer, Shift as Integer, X as Single, Y as Single)
    Picture4.Drag vbBeginDrag

    End Sub




    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Mar 2001
    Location
    USA
    Posts
    6

    Re: Dragging PictureBoxes

    I want something kind of like what happens at:

    http://www.geocities.com/chocolatcreme/dollmaker.html


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

Featured