前言
我最近在照著教程敲代碼,WPF深入講解第8集。發(fā)現(xiàn)RadioButton按鈕點擊觸發(fā)器不是單選的。WPF中單選和復(fù)選通過RadioButton和CheckButton來進行區(qū)分。我點擊另一個RadioButton之后,之前的Radiobutton沒有取消選擇。
解決方案
在原來的代碼上面天啊及GroupName,就能進行區(qū)分。例如如下文章來源:http://www.zghlxwxcb.cn/news/detail-576177.html
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
<RadioButton GroupName="ListRadio"/>
文章來源地址http://www.zghlxwxcb.cn/news/detail-576177.html
到了這里,關(guān)于WPF RadioButton單選失效的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!