Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 需要使用单选按钮创建测验的帮助吗_C#_Visual Studio 2012 - Fatal编程技术网

C# 需要使用单选按钮创建测验的帮助吗

C# 需要使用单选按钮创建测验的帮助吗,c#,visual-studio-2012,C#,Visual Studio 2012,我不知道如何让它说答案是对的还是错的。 到目前为止,我有: private bool CheckTheAnswer() { if (radioButton2_CheckedChanged) return true; else return false; } 但这是不对的。所以我不知道该怎么做。假设RadioButton2始终保持正确答案,您只需在WPF中检查Checked属性 困惑于如何做什么?你能详细解释一下你想

我不知道如何让它说答案是对的还是错的。 到目前为止,我有:

private bool CheckTheAnswer()
{
        if (radioButton2_CheckedChanged)
            return true;
        else
            return false;
}

但这是不对的。所以我不知道该怎么做。

假设RadioButton2始终保持正确答案,您只需在WPF中检查Checked属性


困惑于如何做什么?你能详细解释一下你想让测验做什么吗?请在你的问题中更具体一些
private bool CheckTheAnswer()
{
    return RadioButton2.Checked;
}