1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Moving objects on a form with the mouse

Discussion in 'Visual Basic ( VB )' started by djvargas, Jul 11, 2006.

  1. djvargas

    djvargas New Member

    Hi

    I am a new member to this forum, so please forgive/correct me if I am posting incorrectly.

    Can anyone help me with a way to move an object on the form (when compiling) by using the mouse? More specifically - I want to find a way to pick up a picture box via left-mouse click and drag it to any position on the form. Once I release left-mouse, the picture box will remain in that position. Any ideas?

    I would like to either get the picture to move from point A to B in either of these manners:

    1. Pick up and drag picture box
    2. Click picture box, then click on form location (unused form space, not on top of another object)

    Thank you for any suggestions :)
     
  2. shabbir

    shabbir Administrator Staff Member

    Just change the control position by picking it up in LButton Down event and as the mouse is moved change in accordingly and LButton up place it where the mouse was released.
     

Share This Page