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"/>
相关推荐
Java Fans6 小时前
在WPF项目中集成Python:Python.NET深度实战指南
python·.net·wpf
布伦鸽13 小时前
C# WPF 左右布局实现学习笔记(1)
笔记·学习·c#·wpf
code bean2 天前
【WPF】WPF 项目实战:构建一个可增删、排序的光源类型管理界面(含源码)
wpf
沉到海底去吧Go2 天前
【图片识别改名】如何批量将图片按图片上文字重命名?自动批量识别图片文字并命名,基于图片文字内容改名,WPF和京东ocr识别的解决方案
ocr·wpf·图片识别改名·图片识别重命名·图片内容改名
lph19722 天前
自定义事件wpf
wpf
code bean2 天前
【WPF】从普通 ItemsControl 到支持筛选的 ItemsControl:深入掌握 CollectionViewSource 用法
wpf
碎碎念的安静2 天前
WPF可拖拽ListView
c#·wpf
界面开发小八哥3 天前
界面组件DevExpress WPF中文教程:Grid - 如何识别行和卡片?
.net·wpf·界面控件·devexpress·ui开发
TwilightLemon4 天前
WPF 使用CompositionTarget.Rendering实现平滑流畅滚动的ScrollViewer,支持滚轮、触控板、触摸屏和笔
wpf
Vae_Mars6 天前
WPF中自定义消息弹窗
wpf