Key event
  1. Key down
  2. Key press
  3. Key up

private void Snake_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Up)
                MessageBox.Show("up");
        }


Graphic event
protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Rectangle rect;

Brush brush = new SolidBrush(Color.Blue);
            rect = new Rectangle(5, 5, 5, 5);
            g.FillRectangle(brush, rect);
       }

시뮬레이터에서 돌려보니 키 이벤트가 도대체 먹지를 않는다 -ㅁ-;
뭐냐능??.....

+ Recent posts