|
-
Apr 7th, 2002, 10:47 PM
#1
Mouse over activex control
I made a button ocx which uses graphics. Say for instance I have 2 sets of images that whenever the mouse is over the control, image 2 is visible and when the mouse if outside the control, image 1 would be visible. Easier said, just like a link button that whenever the mouse is over a link, it changes color then back. How do I do this? I tried using HitTest event but never worked. Pls help. Thanks!
-
Apr 8th, 2002, 12:29 AM
#2
New Member
Hi,
I think you're looking for the SetCapture and ReleaseCapture API calls.
I wrote a control button that changes the backcolour based on mouse overs with the following code...
' Toggle the hover colour on or off
Private Sub SetHoverColour(ByVal x As Single, ByVal y As Single)
On Error Resume Next
With lblCaption
' Check if over the control or not
If (x < 0) Or (y < 0) Or (x > .Width) Or (y > .Height) Or Not mblnUseHover Then
ReleaseCapture
.BackColour = mlngBackColour
Else
SetCapture .hwnd
.BackColour = mlngHoverColour
End If
End With
End Sub
Hope that helps. You should be able to convert that code into what you need.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|