Hamburgler
Board Regular
- Joined
- May 16, 2009
- Messages
- 148
A couple of issues.
I want to use the MouseMove event on ActiveX labels on a worksheet to change the BackColor of the labels while the cursor is over the labels.
I have had some success by using another background label to detect when the cursor leaves the target label and change the color back.
The problem is:
First, detection does not always work properly, especially if the mouse is moved quickly. Is there a way around this.
Second, When the user left clicks on the background label it becomes visible and is moved to the front of the main label temporarily until the cursor is moved off it. I have set the BackStyle property to transparent – and tried a few other things, but cannot prevent this.
Any help would be appreciated.
I want to use the MouseMove event on ActiveX labels on a worksheet to change the BackColor of the labels while the cursor is over the labels.
I have had some success by using another background label to detect when the cursor leaves the target label and change the color back.
Code:
Private Sub TargetLabel_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
TargetLabel.BackColor = RGB(0, 255, 0)
End Sub
Private Sub LabelFrame_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
TargetLabel.BackColor = RGB(255, 0, 0)
End Sub
The problem is:
First, detection does not always work properly, especially if the mouse is moved quickly. Is there a way around this.
Second, When the user left clicks on the background label it becomes visible and is moved to the front of the main label temporarily until the cursor is moved off it. I have set the BackStyle property to transparent – and tried a few other things, but cannot prevent this.
Any help would be appreciated.