Results 1 to 3 of 3

Thread: MouseMove for a control array *RESOLVED*

  1. #1

    Thread Starter
    Addicted Member run_GMoney's Avatar
    Join Date
    May 2002
    Location
    Detroit
    Posts
    186

    MouseMove for a control array *RESOLVED*

    Can you use the MouseMove event for a control array so that only one button's backcolor will change? As of now, every button changes color when the MouseMove event is fired. Thanks
    Last edited by run_GMoney; Sep 4th, 2002 at 04:27 PM.

  2. #2
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Command1(Index).BackColor = Something.

    You have to specify which button by Index which is given to you in the event.

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

    Try this...

    VB Code:
    1. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    2. Private Declare Function ReleaseCapture Lib "user32" () As Long
    3. Private Declare Function GetCapture Lib "user32" () As Long
    4.  
    5. Private Sub cmdTest_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    6. If Index = 1 Then
    7.     If (X < 0) Or (Y < 0) Or (X > cmdTest(Index).Width) Or (Y > cmdTest(Index).Height) Then ' the MOUSELEAVE pseudo-event
    8.            ReleaseCapture
    9.            cmdTest(Index).BackColor = &H8000000F
    10.     ElseIf GetCapture() <> cmdTest(Index).hwnd Then
    11.            SetCapture cmdTest(Index).hwnd
    12.            cmdTest(Index).BackColor = vbCyan
    13.     End If
    14. End If
    15. 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