Clear all radio buttons in a page

前端 未结 5 499
误落风尘
误落风尘 2021-01-13 13:08

I have lot of dynamically generated radio buttons in my Windows Forms project. They may be checked based on the values in a database. I want to clear all radio buttons in a

5条回答
  •  被撕碎了的回忆
    2021-01-13 13:39

    I encountered a similar problem, where none of these other answers were useful.

    I wanted to initialize a Winform Dialog with 2 Radiobuttons, that should be both unchecked. The user has to make an explicit choice, before something is selected (like in this question: https://ux.stackexchange.com/questions/76181/radio-buttons-with-none-selected).

    Problem was: the first RadioButton (the one with the lower TabIndex) was always pre-checked. Manually unchecking one, just checked the other one (no matter if in constructor or at the Load Event).

    Resolution: set the TabStop property to false for both RadioButtons. Don't ask me why though.

提交回复
热议问题