Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
On my form, I have 4 RadioButtons, each with it's appearance set to 'Button'. In my program, I change each of these RadioButtons' ForeColour, BackColour and AutoCheck status, as below:
VB
ARadioButton.AutoCheck = False
ARadioButton.BackColor = Color.FromKnownColor(KnownColor.ControlLightLight)
ARadioButton.ForeColor = Color.FromKnownColor(KnownColor.ControlDark)

However, later on, I reset these properties back to default:
VB
ARadioButton.AutoCheck = True
ARadioButton.BackColor = DefaultBackColor
ARadioButton.ForeColor = DefaultForeColor

My issue is that instead of the entire button highlighting (when clicked on) after this change, only the outside highlights, as in the images below.
Originally:
http://i30.photobucket.com/albums/c339/JOFA666/Original_zpsd8b20ef3.png[^]
After changes made, and RadioButtons reset:
http://i30.photobucket.com/albums/c339/JOFA666/AfterChanges_zpsa23824c0.png[^]
I know this may seem menial, but I would like the entire button to highlight when the user clicks on the RadioButton, not just the outside. Is there a way I could somehow reset this?
Thanks for the help!
Posted
Updated 11-Jun-14 21:50pm
v2
Comments
Sergey Alexandrovich Kryukov 12-Jun-14 3:24am    
Radio button? Which one? Do you think there is only one type named "RadioButton"? No. Full type name, please.
—SA
JOFA666 12-Jun-14 3:38am    
My apologies for not being clearer. I understand fully how a radiobutton works. The pictures show 4 radiobuttons, the first one is 'ARadioButton', then 'BRadioButton' and so on (its a Multiple Choice thing). I don't mean 'a' radio button. I didn't include the code for all 4 as it is the same thing repeated for each, and would be pointless. Each RadioButton has the same issue. If it makes it easier for you, refer to 'ARadioButton' as 'Option1RadioButton'.
Sergey Alexandrovich Kryukov 12-Jun-14 3:43am    
Okay, very nice. Now, please a type of "RadioButton". Do you want people making the guesswork? This is possible, but why?
—SA
JOFA666 12-Jun-14 3:52am    
Could you be more specific on your statement 'type of RadioButton'. It is a normal radiobutton on a VB form. What else would you like to know? BTW, I have since improved the question. I am specifically referring to when the user clicks on the RadioButton.
JOFA666 12-Jun-14 4:11am    
You must have absolutely nothing to do if you fill your time by stalking people's profiles and downvoting every question they have ever asked. I originally thought this website was about sharing coding knowledge with the community, but clearly it's about trolling people for fun.

1 solution

The solution for resetting is simply:
VB
ARadioButton.BackColor = Color.Transparent
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900