我真的是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