Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello all,

I am using user settings to store the checked property of a control. The issue I have is: For example I have two radio buttons on my form. rb1 is checked by default, rb2 is unchecked by default. Now if I click rb2, the checked state of rb1 changes to uncheckedm but rb2 still remains unchecked, too. Only after I click rb2 again (NOT double click), the checked state of rb2 changes to checked.

This must have to do with the settings stuff, when the controls' properties are not bound to a setting they work as they should.

When I get the settings manually instead of "binding" them via the Designer, all is working fine:

C#
rb1.Checked = Properties.Settings.Default.rb1;
            rb2.Checked = Properties.Settings.Default.rb2;


...shows normal behavior of the radio buttons.

So, what do I need to do to use the Designer to apply the settings but having the same result as by doing this manually?


More weird is that for most of the checkboxes I have on my form, this issue does not appear, but still for SOME of them; I can't see any difference in code or properties for those which work and those which don't.

I appreciate any hints and tipps,
Best
Dennis
Posted
Updated 2-Jan-13 1:19am
v2
Comments
Jibesh 2-Jan-13 7:25am    
radio buttons default behavior is that only one of the rb is in checked state in a group. the best thing you can do is do not set all the rb to true/false instead select any one of the rb you want as true/false in a group.

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



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