[Resolved] Alternate colour displays on the button
Hi guy, am new to vb.net. I want to ask a question whereby, if I have created a button, and I wanted this button to change colour evey after a click.
I know can use Button1.backcolor= colour.Black, but i wanted to have two different colours.
Example from black->white for 1st click and from white->black after the 2nd click and this will go on for each and every click.
If anyone knows how to do it please help me, post your codes to to let me have a clearer picture too. Thank you every much. :)
Re: Alternate colour displays on the button
If you only wanted to do it with two colours then this would work...
Code:
If Button1.BackColor.Equals(Color.White) Then
Button1.BackColor = Color.black
Button1.Forecolor = Color.White
Else
Button1.BackColor = Color.White
Button1.Forecolor = Color.Black
End If
Re: [Resolved]Alternate colour displays on the button
Oh.. thank you every much!
Been spending hours trying to solve it... thanks for ur codes
Re: [Resolved] Alternate colour displays on the button