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"/>
相关推荐
syty202010 小时前
shardingsphere加载过程
wpf
Dream achiever10 小时前
7.WPF 的 TextBox 和 TextBlock 控件
开发语言·c#·wpf
玖笙&10 小时前
✨WPF编程基础【1.1】:XAML文档框架
c++·visualstudio·wpf
Dream achiever15 小时前
8.WPFTextBox控件的鼠标和键盘事件
开发语言·c#·wpf
Dream achiever16 小时前
10.WPF布局
开发语言·c#·wpf
多多*1 天前
linux安装hbase(完)
java·分布式·算法·c#·wpf
mingupup1 天前
理解WPF Stylet中Command=“{s:Action 方法名}“的设计与实现
wpf
猫林老师2 天前
实战:基于HarmonyOS 5构建分布式聊天通讯应用
分布式·wpf·harmonyos
苦荞米2 天前
C#的MVVM架构中的几种数据绑定方式
wpf
诸葛务农2 天前
储能材料:弹性势能储能及材料技术突破
wpf·能源