I know how to change the background color of a button or label in properties, but I need help figuring out how to get it to change when it is clicked.
melanie.braley
0
Newbie Poster
Recommended Answers
Jump to PostBetter to not refer to the control by name. In the Click handler do
Dim btn As Button = sender sender.BackColor = Color.Red
or more simply
DirectCast(sender, Button).BackColor = Color.Red
you might even get away with
sender.BackColor = Color.Red …
Jump to Post
Button1.BackColor=Color.Blue
Changes the button's color to BlueLabel1.BackColor=Color.Blue
Changes the label's color to Blue
but note that the label should not be transparent
Jump to PostIf so then msg me me I will give the codes for it so.
Code should be posted in the thread for everyone to benefit from.
All 9 Replies
Jalouly
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Sana Mirza
0
Newbie Poster
yuvjeeth
0
Newbie Poster
DM Galaxy
-6
Junior Poster in Training
Reverend Jim
commented:
Do not help via PM
-3
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
DM Galaxy
-6
Junior Poster in Training
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
DM Galaxy
-6
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.