yankarinRG
New member
- Local time
- Today, 16:57
- Joined
- Nov 6, 2016
- Messages
- 5
Hello,
I've got a form which works as a menu with a pair of buttons with a black picture and caption. When the mouse is over the button, the picture and the caption turn white.
That's how I did it:
-Added the black and white images to the database gallery;
-Set the CommandButton.PictureType Property to shared;
-Set the CommandButton.Picture Property to "black";
Now in VBA:
This is to revert to black if the cursor leaves the button.
However I think this event handling can become pretty slow, since the CPU use on my PC (i7-3770K) raises from 1% to 6%.
Is there a better/more elegant solution to do this?
Thanks!
I've got a form which works as a menu with a pair of buttons with a black picture and caption. When the mouse is over the button, the picture and the caption turn white.
That's how I did it:
-Added the black and white images to the database gallery;
-Set the CommandButton.PictureType Property to shared;
-Set the CommandButton.Picture Property to "black";
Now in VBA:
Code:
Private Sub btnTest_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Me.btnTest.Picture = "white" Then
Exit Sub
Else
Me.btnTest.Picture = "white"
End If
End Sub
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Me.btnTest.Picture = "black" Then
Exit Sub
Else
Me.btnTest.Picture = "black"
End If
End Sub
However I think this event handling can become pretty slow, since the CPU use on my PC (i7-3770K) raises from 1% to 6%.
Is there a better/more elegant solution to do this?
Thanks!