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"/>
相关推荐
c#上位机11 小时前
wpf中Grid的MouseDown 事件无法触发的原因
c#·wpf
△曉風殘月〆11 小时前
如何在WPF中实现ComboBox多选
wpf
csdn_aspnet14 小时前
如何使用现有工具进行 .NET 8 迁移 Wpf
wpf·.net 8
123梦野1 天前
WPF——动画
wpf
攻城狮CSU1 天前
WPF 疑点汇总2.HorizontalAlignment和 HorizontalContentAlignment
wpf
c#上位机2 天前
wpf之命令
c#·wpf
没有bug.的程序员2 天前
分布式链路追踪:微服务可观测性的核心支柱
java·分布式·微服务·架构·wpf
Aevget2 天前
DevExpress WPF中文教程:Data Grid - 如何使用虚拟源?(一)
c#·wpf·界面控件·devexpress·ui开发
The Sheep 20234 天前
WPF自定义路由事件
大数据·hadoop·wpf
阳光雨滴4 天前
使用wpf用户控件编程落石效果动画
c++·wpf