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"/>
相关推荐
脚踏实地皮皮晨10 小时前
003003002_WPF Grid 基类官方类定义逐行深度解析
开发语言·windows·算法·c#·wpf·visual studio
脚踏实地皮皮晨1 天前
003002004_WPF Panel 基类 官方类定义
开发语言·windows·算法·c#·wpf·visual studio
湿滑路面2 天前
Rouyan:使用WPF/C#构建的基于LLM的快捷翻译小工具
开发语言·c#·wpf
软萌萌的12 天前
C#中的多级缓存架构设计与实现深度解析
缓存·c#·wpf
dalong102 天前
WPF:3D正八面体自动旋转
3d·wpf
仙宇觉尘2 天前
WPF Stylet可以如何实现导航功能?
java·开发语言·wpf
丙氨酸長鏈2 天前
WPF 引用 ASP.NET Core 的 AOT 版本
后端·asp.net·wpf
Xin_ye100862 天前
第六章:破局——WPF内存泄漏解决方案
c#·wpf
FuckPatience3 天前
WPF Button Content 的StringFormat
java·前端·wpf
dalong103 天前
WPF:3D正四面体旋转改错
3d·wpf