Graphics g = this.pictureBox1.CreateGraphics();
Brush brush = new SolidBrush(Color.White);
Pen pen = new Pen(brush, 1);
//pen.DashStyle = DashStyle.Solid;//using System.Drawing.Drawing2D;
pen.DashPattern = new float[]{2,10};
pen.DashStyle = DashStyle.Custom;
g.DrawLine(pen,new Point(x1,y1),new Point(x2,y2));
g.Dispose();
Brush brush = new SolidBrush(Color.White);
Pen pen = new Pen(brush, 1);
//pen.DashStyle = DashStyle.Solid;//using System.Drawing.Drawing2D;
pen.DashPattern = new float[]{2,10};
pen.DashStyle = DashStyle.Custom;
g.DrawLine(pen,new Point(x1,y1),new Point(x2,y2));
g.Dispose();