Witam, mam taki o to kod:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
bool drawBlack = true;
for (int x = 0; x < 8; x++)
{
for (int y = 0; y < 8; y++)
{
if (drawBlack)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
System.Drawing.Graphics formGraphics = this.CreateGraphics();
formGraphics.FillRectangle(myBrush, new Rectangle(20, 20, 20, 20));
myBrush.Dispose();
formGraphics.Dispose();
}
else
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.White);
System.Drawing.Graphics formGraphics = this.CreateGraphics();
formGraphics.FillRectangle(myBrush, new Rectangle(20, 20, 20, 20));
myBrush.Dispose();
formGraphics.Dispose();
}
drawBlack = !drawBlack;
}
drawBlack = !drawBlack; // zeby kolejnosc w nastepnej linii pol czarne-biale byla inna, niz w poprzedniej linii
}
}
}
}
mający rysować planszę pod szachy jednak nie realizuje on się. Proszę o pomoc i Pozdrawiam.