Results 1 to 2 of 2

Thread: Mousepos and Move

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482

    Post

    Hey I need a way to, where you click on a picture on the form, and then where ever you will click this out picture will move to.

    As in, top left of picture is 0,0 bottom right is like 500,300 i'm not sure right now but this will start me off.
    Thanks

  2. #2
    Member
    Join Date
    Nov 1999
    Location
    Kansas, USA
    Posts
    58

    Post

    Well, you should be able to use the MouseDown event of whatever the mouse is over when you click to move the picture. Say there's nothing there but the form, you could use:

    Public imgClicked as Boolean

    Private Sub Image1_Click()
    imgClicked = True
    End Sub

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If imgClicked = True then
    Image1.Left = X
    Image1.Top = Y
    imgClicked = False
    End If
    End Sub

    After you click on Image1, then click somewhere else on the form and this will move Image1 to wherever you click. Hope this helps.

    ------------------
    Mike Wellems
    PowerQuery

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