RadioButton.Checked错误:Control.Checked不能出现在+ =或左手边 - = [英] RadioButton.Checked Error: Control.Checked cannot appear on the left hand side of += or -=

查看:830
本文介绍了RadioButton.Checked错误:Control.Checked不能出现在+ =或左手边 - =的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有奇怪的问题,我必须失去了一些东西。

I am having the strangest problem, and I have to be missing something.

下面是我的代码导致错误。

Here is my code that is causing the error.

if (radLot.Checked == true)
{
    SymbolSpecification = "LotRenderer";
}

if (radWaterMeter.Checked == true)
{
    SymbolSpecification = "WaterMeterRenderer";
}



正如你所看到的,我甚至不使用= +或 - = ......我居然没有在我的代码的任何地方...任何帮助,将不胜感激。

As you can see, I don't even use =+ or -=... I actually don't have it anywhere in my code... Any help would be appreciated.

推荐答案

<一个HREF =htt​​p://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.togglebutton.checked相对=nofollow> 经过 是当一个切换按钮被选中时引发事件的名称。 (在单选类从切换按钮派生的。)

Checked is the name of the event that is raised when a ToggleButton is checked. (The RadioButton class derives from ToggleButton.)

我假设你要访问的 器isChecked 属性,该属性获取(或设置)是否切换按钮被选中。

I assume you want to access the IsChecked property, which gets (or sets) whether the ToggleButton is checked.

if (radLot.IsChecked == true)
{
    SymbolSpecification = "LotRenderer";
}



提示:相关的可视​​状态开始与大多数布尔属性是 - 在WPF

这篇关于RadioButton.Checked错误:Control.Checked不能出现在+ =或左手边 - =的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆