码迷,mamicode.com
首页 > 其他好文 > 详细

十字光标定位

时间:2019-01-15 22:06:38      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:技术分享   rap   运用   send   arp   vat   raw   int   graphics   

实现效果:

  技术分享图片

知识运用:

  Graphics对象的DrawLine方法

  public void DrawLine (Pen pen, Point pt1,Point pt2)

  public void DrawLine (Pen pen, int x1,int y1,int x2,int y2)

实现代码:

        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            Graphics g = this.CreateGraphics();
            g.DrawLine(new Pen(Color.Black,2),new Point(0,e.Y),new Point(this.Width,e.Y));
            g.DrawLine(new Pen(Color.Black, 2), new Point(e.X, 0), new Point(e.X,this.Height));
        }

 

十字光标定位

标签:技术分享   rap   运用   send   arp   vat   raw   int   graphics   

原文地址:https://www.cnblogs.com/feiyucha/p/10274393.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!