用c# 写了一个五子棋
用
protected override void OnPaint(PaintEventArgs e)
{
System.Drawing.Graphics g = this.CreateGraphics();
for (int x = 0; x < 15; x++)
{
for (int y = 0; y < 15; y++)
{
Box[y, x] = Chess.None ;// } }
// base.OnPaint(e);
Graphics h = this.CreateGraphics();
Pen pen1 = new Pen(Color.Black, 1);
for (int i = 0; i < 15; i++)
{
h.DrawLine(pen1, 40, 30 * i + 40, 460, 30 * i + 40);
h.DrawLine(pen1, 30 * i + 40, 40, 30 * i + 40, 460);
}
pen1.Dispose();
}
画了棋盘图形
棋子也是用Graphics 画的
运行完一次之后
屏幕上 刚刚下过的棋子没有删除
没有办法继续下了 有什么办法可以把上面的棋子删除
把棋盘留下么?? 谢谢了各位
用
protected override void OnPaint(PaintEventArgs e)
{
System.Drawing.Graphics g = this.CreateGraphics();
for (int x = 0; x < 15; x++)
{
for (int y = 0; y < 15; y++)
{
Box[y, x] = Chess.None ;// } }
// base.OnPaint(e);
Graphics h = this.CreateGraphics();
Pen pen1 = new Pen(Color.Black, 1);
for (int i = 0; i < 15; i++)
{
h.DrawLine(pen1, 40, 30 * i + 40, 460, 30 * i + 40);
h.DrawLine(pen1, 30 * i + 40, 40, 30 * i + 40, 460);
}
pen1.Dispose();
}
画了棋盘图形
棋子也是用Graphics 画的
运行完一次之后
屏幕上 刚刚下过的棋子没有删除
没有办法继续下了 有什么办法可以把上面的棋子删除
把棋盘留下么?? 谢谢了各位
http://blog.csdn.net/hbxtlhx/archive/2007/08/31/1766913.aspx
我会看的我是新学c#的 以前学的是c 还没有看明白e.Graphics知道了 我会改的在此谢了 不过我要先去上课 ^_^
【翻译】直线箭头和曲线箭头的绘制
http://bbs.msproject.cn/Default.aspx?g=posts&t=388