Results 1 to 4 of 4

Thread: Get x , y of drag moded picture box

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    I can't believe I can't do this! Any help? I take a picture box and set dragmode to automatic but can't get my Picbox.cursor-position unless I right click! I want to left click and set X to OldX and Y to OldY. I need this to smoothly drop it in the DragDrop sub using:

    source.move (X - OldX),(Y - OldY)

    Please help!

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    I'm bringing this to the top as I was quite late posting. Thanks, hope you all can help.
    A friend of mine has just informed me he is having similiar problems with left click on drag of treeview nodes.I really hope you can help us.
    Thanks,
    Joey O.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Wink

    C'mon guys, do you just answer the easy ones? This is a problem you will eventually run into.Please help me out.

  4. #4
    Guest
    If you set the DragMode to Manual, it might be easier.

    Code:
    Dim OldX As Single
    Dim OldY As Single
    
    Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
    
        Source.Left = X - OldX
        Source.Top = Y - OldY
        
    End Sub
    
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
        If Button = 1 Then
            OldX = X
            OldY = Y
            Picture1.Drag
        End If
        
    End Sub

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