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"/>
相关推荐
hqwest7 小时前
C#WPF实战出真汁06--【系统设置】--餐桌类型设置
c#·.net·wpf·布局·分页·命令·viewmodel
Vae_Mars9 小时前
WPF中使用InputBindings进行快捷键绑定
wpf
hqwest13 小时前
C#WPF实战出真汁05--左侧导航
开发语言·c#·wpf·主界面·窗体设计·视图viewmodel
hqwest19 小时前
C#WPF实战出真汁01--项目介绍
开发语言·c#·wpf
wuty0071 天前
WPF 实现支持动态调整高度的文本显示控件
wpf·scrollviewer·extentheight·自动高度控件·动态调整高度
范纹杉想快点毕业4 天前
C 语言主控开发与显控开发能力体系及技术栈详解,STM32、QT、嵌入式、边缘系统显示
stm32·单片机·tcp/ip·microsoft·fpga开发·51单片机·wpf
weixin_447103585 天前
WPF之绑定!
c#·wpf
DataIntel5 天前
wpf问题记录
wpf
蓝点lilac6 天前
C# WPF 内置解码器实现 GIF 动图控件
c#·.net·wpf·图像
@Jackasher6 天前
Redis如何实现一个分布式锁?
redis·分布式·wpf