|
-
Oct 10th, 2005, 09:35 AM
#1
Thread Starter
Member
[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.
Last edited by jtVNB; Oct 10th, 2005 at 09:53 AM.
Reason: Resolved
-
Oct 10th, 2005, 09:45 AM
#2
Addicted Member
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
Look into the heart of infinity and find your truth
Colonel Tom Edwards: This is the most fantastic story I've ever heard
Jeff Trent: And every word of it's true, too
Colonel Tom Edwards: That's the fantastic part of it
ROFL 
-
Oct 10th, 2005, 09:52 AM
#3
Thread Starter
Member
Re: [Resolved]Alternate colour displays on the button
Oh.. thank you every much!
Been spending hours trying to solve it... thanks for ur codes
-
Oct 10th, 2005, 09:55 AM
#4
Addicted Member
Re: [Resolved] Alternate colour displays on the button
No probs m8
Look into the heart of infinity and find your truth
Colonel Tom Edwards: This is the most fantastic story I've ever heard
Jeff Trent: And every word of it's true, too
Colonel Tom Edwards: That's the fantastic part of it
ROFL 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|