WPF RadioButton单选失效

文章目录

前言

我最近在照着教程敲代码,WPF深入讲解第8集。发现RadioButton按钮点击触发器不是单选的。WPF中单选和复选通过RadioButton和CheckButton来进行区分。我点击另一个RadioButton之后,之前的Radiobutton没有取消选择。

解决方案

在原来的代码上面天啊及GroupName,就能进行区分。例如如下

html 复制代码
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
相关推荐
葬歌倾城20 分钟前
waferMap图像渲染
c#·wpf
甄天1 小时前
WPF路由事件:冒泡、隧道与直接全解析
c#·wpf·visual studio
三千道应用题3 小时前
WPF学习笔记(12)下拉框控件ComboBox与数据模板
wpf
界面开发小八哥4 小时前
界面组件DevExpress WPF中文教程:Grid - 如何获取节点?
.net·wpf·界面控件·devexpress·ui开发
三千道应用题4 小时前
WPF学习笔记(22)项面板模板ltemsPanelTemplate与三种模板总结
wpf
佛·追命9 小时前
.net wpf混淆
.net·wpf
weixin_4471035811 小时前
Wpf布局之StackPanel!
wpf
小老鼠爱大米11 小时前
[C#] WPF - 资源URI
c#·wpf·uri
三千道应用题19 小时前
WPF学习笔记(13)列表框控件ListBox与数据模板
wpf
甄天10 天前
WPF中MVVM和MVVMLight模式
c#·wpf·visual studio