GDI+是一种绘图装置接口, 当拖动窗体是,窗体发生移动,window默认为从窗体移动到另一个地方,先发生擦除后再重新画一个窗体: 而我们自己动手画的图(如下面的线),不会重新画:在属性中,Paint,中,将画图的程序重新写一遍就可实现重画. 画一条线 private void button1_Click(object sender, EventArgs e) { // 创建GDI Graphics g = this.CreateGraphics(); //创建两个点 Point n1=new…