本文介绍了鼠标单击事件不在webbrowser控件上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用浏览器,我需要在vb.net上检索鼠标点击的坐标,如果我使用了webbrowser控件,我试图在该webbrowser上有一个透明的面板,这个面板总是有控件颜色,即使我将BGcolor更改为透明,请帮助
I''m Working on a browser , and I need to retrieve the coordinate of mouse click on vb.net if I used webbrowser control , I tried to have a transparent Panel over that webbrowser , this panel always has control color , even when I change the BGcolor to transparent ,, Please help
推荐答案
Public Class Form1
Dim WithEvents doc As HtmlDocument
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If WebBrowser1.Url.Equals(e.Url) Then
doc = WebBrowser1.Document
End If
End Sub
Private Sub doc_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs) Handles doc.Click
Debug.WriteLine(e.MousePosition)
Debug.WriteLine(e.ClientMousePosition)
End Sub
End Class
这篇关于鼠标单击事件不在webbrowser控件上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!