找了半天怎么只有DrawLine呢?菜鸟,轻拍
给个例子
马上结贴

解决方案 »

  1.   

     private void Form1_Paint(object sender, PaintEventArgs e)
            {
                using (System.Drawing.Graphics g = e.Graphics)
                {
                    g.DrawLine(Pens.Black, 0, 0, 100, 100);
                }
            }
      

  2.   

    虚线private void Form1_Paint(object sender, PaintEventArgs e)
            {
                using (System.Drawing.Graphics g = e.Graphics)
                {
                    g.DrawLine(Pens.Black, 0, 0, 100, 100);              
                    Pen p = new Pen(Color.Blue);
                    p.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                    g.DrawLine(p, 200, 200, 100, 100);
                }
            }
      

  3.   

    System.Drawing.Drawing2DCustom 指定用户定义的自定义划线段样式。  
    Dash 指定由划线段组成的直线。  
    DashDot 指定由重复的划线点图案构成的直线。  
    DashDotDot 指定由重复的划线点点图案构成的直线。  
    Dot 指定由点构成的直线。  
    Solid 指定实线。