Reputation: 25
I wanna change the font color of Y & in the below code. Do assist if i change color in commandbutton properties i applies both to Y and M. I want to have independent color for both
If checker = False Then
CommandButton1.Caption = "Y"
checker = True
Else
CommandButton1.Caption = "m"
checker = False
End If
CommandButton1.Enabled = False
Upvotes: 0
Views: 435
Reputation: 11755
You can use the ForeColor
property. This is a fairly easy thing to look up online. You can also just look at the properties of the button object in the designer.
It makes no difference if it is within an If condition.
CommandButton1.ForeColor = vbYellow
Upvotes: 1