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 WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
// InitializeComponent();
}
private void InitializeComponent()
{
this.(EventArgs.Empty);
}
protected const int xNum=5;
protected const int yNum = 4;
protected bool[,] abChecked = new bool[yNum,xNum];
protected int cxBlock, cyBlock;
private void Form1_Resize(object sender, EventArgs e)
{
cxBlock = ClientSize.Width / xNum;
xyBlock = ClientSize.Height / yNum;
Invalidate();
}
private void Form1_MouseUp(object sender, MouseEventArgs e)
{
int x = e.x / cxBlock;
int y = e.y / cyBlock;
if(x<xNum && y<yNum){
abChecked[y, x] ^= true;
Invalidate(new Rectangle(x * cxBlock, y * cyBlock, cxBlock, cyBlock));
}
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen pen = new Pen(ForeColor);
for (int y = 0; x < yNum; xNum++)
{
for (int x = 0; x < xNum; x++)
{
g.DrawRectangle(pen, x * cxBlock, y * cyBlock, cxBlock, cyBlock);
if (abChecked[y, x])
{
g.DrawLine(pen, x * cxBlock, y * cyBlock, (x + 1) * cxBlock, (y + 1) * cyBlock);
g.DrawLine(pen,x*cxBlock,(y+1)*cyBlock,(x+1)*cyBlock,y*cyBlock);
}
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
여기서 오류가 나는데 오류나는 화면 캡쳐해서 올렷는데요 이거 어떻게 해야 하나요?