//比如在Panel1上绘图
Point pStart;
Point pTemp;
Point pEnd;
int intFlag = 0;
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
pStart = new Point(e.X, e.Y);
intFlag = 1;
a += 1;
b += 1;
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
intFlag = 0;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (intFlag == 1)
{
Line l = new Line(pTemp, pEnd, Color.Black,1);
l.draw(this.panel1);
}
pTemp = pEnd;
}
[
本帖最后由 xydddaxia 于 2012-4-5 17:21 编辑 ]