源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

浅析c#中如何在form的webbrowser控件中获得鼠标坐标

  • 时间:2022-04-20 07:45 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:浅析c#中如何在form的webbrowser控件中获得鼠标坐标
[img]http://files.jb51.net/file_images/article/201307/201307311022319.jpg[/img] 如图这样,其实是要插入一个time的控件,这样才能使得坐标值会根据鼠标的移动而不停变化。time插件中写
[u]复制代码[/u] 代码如下:
private void timer1_Tick(object sender, EventArgs e)         {             if (webBrowser1.Bounds.Contains(this.PointToClient(Cursor.Position)))             {                 this.toolStripStatusLabel1.Text = webBrowser1.PointToClient(Cursor.Position).ToString();             }         }     }
这是在webbrowser中实现的。 要记得在form_load中,加入timer1.Start();这样它才会启动!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部