Results 1 to 3 of 3

Thread: mouse move

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    36

    mouse move

    how to make a button get highlight or faded after we move mouse pointer on the button and the button attributes back to normal after mouse not on the button??can give source code sample??

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

    Re: mouse move

    vb Code:
    1. Option Explicit
    2.  
    3. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    4. Private Declare Function ReleaseCapture Lib "user32" () As Long
    5. Private Declare Function GetCapture Lib "user32" () As Long
    6.  
    7. Private Const vbGray = &H8000000F
    8.  
    9. Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    10. 'the button style must be set to graphical for this to work
    11. If (X < 0) Or (Y < 0) Or (X > Command1.Width) Or (Y > Command1.Height) Then
    12.      ReleaseCapture ' the mouse is no longer over the button, change backcolor to gray
    13.      Command1.BackColor = vbGray
    14. ElseIf GetCapture() <> Command1.hwnd Then
    15.     SetCapture Command1.hwnd ' the mouse is over the button, change backcolor to cyan
    16.      Command1.BackColor = vbCyan
    17. End If
    18. End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    36

    Re: mouse move

    how bout change the size of command1/faded the button(work like toolbar)...any idea
    sorry for asking many question, im new in vb6
    Last edited by kickent; Apr 21st, 2009 at 10:42 PM.

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