WebBrowser 中是没有MouseMove 事件的。想获取鼠标在WebBrowser中的坐标位置需要另辟蹊径、方法如下

在窗体中加入Timer控件

            timer1.Tick+=new EventHandler(timer1_Tick);
            timer1.Start();
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (webBrowser1.Bounds.Contains(this.PointToClient(Cursor.Position)))
            {

                lbXY.Text = webBrowser1.PointToClient(Cursor.Position).ToString();
            }

        }

把获取的位置给lbXY,虽然代码不多,但也让我费了些周折。

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2022-02-01
猜你喜欢
  • 2022-01-23
  • 2022-03-09
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案