求大神指点 哪里错了?
巍巍哥 2012-05-29 03:47:57 private void lblMode_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
return;
int xPos, yPos;
xPos = e.X / 31;
yPos = e.Y / 31;
struArr[xPos, yPos] = !struArr[xPos, yPos];
bool b = struArr[xPos, yPos];
Graphics gp = lblMode.CreateGraphics();
SolidBrush s = new SolidBrush(b ? blockColor : Color.Black);
gp.FillRectangle(s, 31 * xPos + 1, 31 * yPos + 1, 30, 30);
gp.Dispose;
}