I
IanKR
I have a ToggleButton on a worksheet in a project I'm developing for a
cricket scorebook. I'd like it to change colour when pressed. This is my
code:
Private Sub togNoBall_Click()
With togNoBall
'when not pressed
If .Value = False Then
.BackColor = &H8000000F 'grey = default button colour
End If
'when pressed
If .Value = True Then
.BackColor = RGB(255, 0, 0) 'bright red
'[I shall eventually put some other code in here, to fire up the
No Ball Userform]
End If
End With
End Sub
I want it to change to red when clicked, and back to grey when "unclicked"
(or not clicked at all). The problem is, it does change colour, but not to
the bright, solid, vivid red that I'd expect. It changes to a sort of pink -
like if the red is mixed with grey. When it is clicked (and is the pink/grey
colour), and I then click on it again, before it changes back to grey, but
while the click is held down, it does change to the red colour I'd like it
to be, when clicked. A similar thing happens when I use other colours.
Is this due to some Windows appearance setting on my PC, outside of Excel?
Thanks
Ian
cricket scorebook. I'd like it to change colour when pressed. This is my
code:
Private Sub togNoBall_Click()
With togNoBall
'when not pressed
If .Value = False Then
.BackColor = &H8000000F 'grey = default button colour
End If
'when pressed
If .Value = True Then
.BackColor = RGB(255, 0, 0) 'bright red
'[I shall eventually put some other code in here, to fire up the
No Ball Userform]
End If
End With
End Sub
I want it to change to red when clicked, and back to grey when "unclicked"
(or not clicked at all). The problem is, it does change colour, but not to
the bright, solid, vivid red that I'd expect. It changes to a sort of pink -
like if the red is mixed with grey. When it is clicked (and is the pink/grey
colour), and I then click on it again, before it changes back to grey, but
while the click is held down, it does change to the red colour I'd like it
to be, when clicked. A similar thing happens when I use other colours.
Is this due to some Windows appearance setting on my PC, outside of Excel?
Thanks
Ian