WPF RadioButton single selection fails

Article directory

foreword

I'm typing code according to the tutorial recently, and WPF explains the 8th episode in depth . Found that the RadioButton button click trigger is not radio. RadioButton and CheckButton are used to distinguish single selection and multi-selection in WPF. After I click another RadioButton, the previous Radiobutton is not deselected.

insert image description here

solution

God and GroupName above the original code can be distinguished. For example as follows

<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>

insert image description here

Guess you like

Origin blog.csdn.net/qq_44695769/article/details/131740973