I used btn[x,y].AllowDrop = false but
if (btn[x,y].BackColor == Color.Red) AllowDrop property must be true ...And ok everything is good now
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.AllowDrop = true;
btn[x, y] = new Button();
btn[x, y].AllowDrop = true;
}
void btn_DragDrop(object sender, DragEventArgs e)
{
Button button = (Button)sender;
button.Image = (Bitmap)e.Data.GetData(DataFormats.Bitmap);
int[] dizi = (int[])button.Tag;
int x = dizi[0];
int y = dizi[1];
for (int a = 0; a <= 7; a++)
{
for (int b = 0; b <= 7; b++)
{
btn[a, b].AllowDrop = false;
}
}
if ((x + 1 >= 0 && y + 2 <= 7) && (y + 2 >= 0 && x + 1 <= 7))
{
btn[x + 1, y + 2].BackColor = Color.Red;
btn[x + 1, y + 2].AllowDrop = true;
}
if ((x + 1 >= 0 && y - 2 <= 7) && (y - 2 >= 0 && x + 1 <= 7))
{
btn[x + 1, y - 2].BackColor = Color.Red;
btn[x + 1, y - 2].AllowDrop = true;
}
if ((x - 1 >= 0 && y + 2 <= 7) && (y + 2 >= 0 && x - 1 <= 7))
{
btn[x - 1, y + 2].BackColor = Color.Red;
btn[x - 1, y + 2].AllowDrop = true;
}
if ((x - 1 >= 0 && y - 2 <= 7) && (y - 2 >= 0 && x - 1 <= 7))
{
btn[x - 1, y - 2].BackColor = Color.Red;
btn[x - 1, y - 2].AllowDrop = true;
}
if ((x + 2 >= 0 && y + 1 <= 7) && (y + 1 >= 0 && x + 2 <= 7))
{
btn[x + 2, y + 1].BackColor = Color.Red;
btn[x + 2, y + 1].AllowDrop = true;
}
if ((x + 2 >= 0 && y - 1 <= 7) && (y - 1 >= 0 && x + 2 <= 7))
{
btn[x + 2, y - 1].BackColor = Color.Red;
btn[x + 2, y - 1].AllowDrop = true;
}
if ((x - 2 >= 0 && y + 1 <= 7) && (y + 1 >= 0 && x - 2 <= 7))
{
btn[x - 2, y + 1].BackColor = Color.Red;
btn[x - 2, y + 1].AllowDrop = true;
}
if ((x - 2 >= 0 && y - 1 <= 7) && (y - 1 >= 0 && x - 2 <= 7))
{
btn[x - 2, y - 1].BackColor = Color.Red;
btn[x - 2, y - 1].AllowDrop = true;
}
}