嗨,我有这个代码(我得到了一个错误,我必须声明一个主体,因为它没有标记为抽象、外部或部分......顺便说一下,我无法让它在这里发布,但就在公共部分类 Form1 上:表格我也写了 bool play1 = true;bool play2 = false; int x=1;int o=10; )当我点击它时,它会上升到我用粗字母标记的那个区域有人可以告诉我什么是错误的以及如何逐步解决
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
værdier();
int[] status = new int[9];
zeihne();
}
private string[] status;
private void value()
{
int[] status = new int[9];
zeihne();
}
private void zeihne()
{
button1.Text = status[0];
button2.Text = status[1];
button3.Text = status[2];
button4.Text = status[3];
button5.Text = status[4];
button6.Text = status[5];
button7.Text = status[6];
button8.Text = status[7];
button9.Text = status[8];
}
// private void label1_Click(object sender, EventArgs e)
{
}
**private void Form1_Load(object sender, EventArgs e);**
private void button1_Click(object sender, EventArgs e)
{
if (play1 == true)
{
play1 = true;
button1.Text = "X";
play1 = false;
}
else
{
play2 = true;
button1.Text = "O";
play2 = false;
play1 = true;
}