get a Graphics object, then call DrawLine:IntPtr hwnd = new IntPtr();
hwnd = thisForm.Handle;Graphics newGraphics = Graphics.FromHwnd(hwnd);Point myStartPoint = new Point(4, 2);
Point myEndPoint = new Point(12, 6);
newGraphics.DrawLine(new Pen(Color.Red, 3), myStartPoint, myEndPoint);
newGraphics.Dispose();

解决方案 »

  1.   

    try something likePen capPen = new Pen(Color.Black, 5);
    capPen.DashStyle = DashStyle.Dash;
    capPen.SetLineCap(LineCap.ArrowAnchor, LineCap.Flat, DashCap.Flat);
    YourGraphics.DrawLine(capPen, 10, 10, 200, 10);if that is not what you want, then you have to draw separate lines to make an arrow>>>如何由箭头来确定控件之间的排序?
    you have to maintain this kind of relationship in your code
      

  2.   

    to saucer(思归):
        你画出来的是两个固定点之间的直线。我是要把从工具栏拉出来的控件用线连起来,不过我想了一下,我的思路是错的,如果要实现把两个关联起来,那要定义好自己的控件,箭头也作成控件,可以自由伸缩和增加节点(以便拐折)。:)不过不知道如何做!请高手指点!!!
      

  3.   

    这里没有高手吗???
    我想用 System.Drawing.Region不规则区域来实现,只要实现象WORD里的直线就可以,可以由一端来拉伸,不知如何实现