Thread: Button colour
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey[_190_] ExcelMonkey[_190_] is offline
external usenet poster
 
Posts: 172
Default Button colour

Also note that I am doing all of this within the click
event of the chbkx

Private Sub PrintColourMapChkBx_Click()

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If

End Sub


-----Original Message-----
I have a button on a userform. When a certain checkbox
is checked I want the button to appear black. I do this
using the BackColour property and using 17 as the color
number. When the checkbox is not checked I want to turn
the colour of the button back to grey. I am using 15 for
this. However, the button will not change to the colour
denoted by 15 when I do this. That is, it stays at black
(17) even if the chbkx = False. Why is this?

Thanks

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If


.