Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#.NET4WinForm
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:
 
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 2-Jan-13 0:29am
(unknown member)
Edited 2-Jan-13 1:19am
v2
Comments
jibesh at 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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 375
1 Abhinav S 333
2 OriginalGriff 330
3 sanket saxena 305
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,497
1 OriginalGriff 4,850
2 Peter Leow 3,839
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid