Results 1 to 4 of 4

Thread: Follow cursor with a shape

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    1

    Follow cursor with a shape

    is it possible to make a shape follow the cursor if so does anyone know how?

    im using vb6

  2. #2
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    Re: Follow cursor with a shape

    Hi. Yes, it is possible.
    You should try something like this:

    Code:
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Command1.Left = X
    Me.Command1.Top = Y
    End Sub

  3. #3
    Member
    Join Date
    Nov 2006
    Posts
    40

    Re: Follow cursor with a shape

    that's right!!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Follow cursor with a shape

    Welcome to the forums.

    Although RS_Arm's code does work, there needs to be a way to stop if from following the cursor as that behavior can be very annoying.

    Is this for a game?

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