Hi,
I have designed a piano keyboard using Bevelbuttons and Canvas to color the keys
In order to show the black keys I am using this code for Paint event:
Dim fillColor As Color
If mFilled Then
fillColor = &caaaaaa // Gray
Else
fillColor = &c000000 // Black
End If
g.ForeColor = fillColor
g.FillRect(0, 0, Me.Width, Me.Height)
This code for Mousedown event:
mFilled = Not mFilled
Me.Invalidate
I would like to simulate that a key was pressed by changing its color to gray and come back to black when not used.
What I get now is toggling between black and gray.
Thanks for any help