您的位置:首页 > 编程语言 > C#

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

2013-07-30 18:54 225 查看

如图这样,其实是要插入一个time的控件,这样才能使得坐标值会根据鼠标的移动而不停变化。time插件中写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();这样它才会启动!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐