我真的是C#的新手。我已经尝试了好几天了解如何在我的计算器中使用单选按钮。我正在制作一个通过选择单选按钮来工作的计算器。在计算器中使用单选按钮
我已经尝试了从教程到教科书的所有内容。
希望你能帮助我。
这是我失败的代码中的一个
namespace Calculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int x,
y;
x = Convert.ToInt16(textBox1.Text);
y = Convert.ToInt16(textBox2.Text);
if (radioButton1.Checked) ;
Math.Pow(x,y);
if (radioButton2.Checked) ;
(x/y);
if (radioButton3.Cheked) ;
}
}
}
在这种情况下,我百达得到的错误
错误1只分配,调用,递增,递减,并且可以使用新的对象表达式作为声明
我真的不知道该怎么做。
在哪条线上出现错误? – SJD 2014-10-11 10:18:33