خیلی ممنون، اینطوری آدرس دادم اررور آدرس دهی اش رفع شد ولی به اینکه tile رو اونجا تعریف کردم گیر داد. من کجا تعریف اش کنم درست باشه پس؟
namespace _8_puzzleTEST
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void Form1_Load(object sender, EventArgs e)
{
public int[] tile = new int[9];
for (int i = 0; i < 9; i++)
{
tile[i] = i;
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
tile[1]++;
switch (tile[1])
{
case 1:
pictureBox1.Image = Properties.Resources.T1;
break;
case 2:
pictureBox1.Image = Properties.Resources.T2;
break;
case 3:
pictureBox1.Image = Properties.Resources.T3;
break;
case 4:
pictureBox1.Image = Properties.Resources.T4;
break;
case 5:
pictureBox1.Image = Properties.Resources.T5;
break;
case 6:
pictureBox1.Image = Properties.Resources.T6;
break;
case 7:
pictureBox1.Image = Properties.Resources.T7;
break;
case 8:
pictureBox1.Image = Properties.Resources.T8;
break;
case 9:
tile[1]=0;
pictureBox1.Image = Properties.Resources.T0;
break;
}
}