用VB写一个浏览器,webbrowser控件显示的网页中怎么屏蔽鼠标右键?希望哪位大侠能解惑,最后能给个工程文件
1个回答
展开全部
点vb菜单-工程-引用-Microsoft HTML OBject Library
窗体代码:
Dim WithEvents M_Dom As MSHTML.HTMLDocument
Private Function M_Dom_oncontextmenu() As Boolean
M_Dom_oncontextmenu = False
End Function
Private Sub Webbrowser1_DownloadComplete()
Set M_Dom = WebBrowser1.Document
End Sub
窗体代码:
Dim WithEvents M_Dom As MSHTML.HTMLDocument
Private Function M_Dom_oncontextmenu() As Boolean
M_Dom_oncontextmenu = False
End Function
Private Sub Webbrowser1_DownloadComplete()
Set M_Dom = WebBrowser1.Document
End Sub
追问
那怎么屏蔽错误信息啊?
追答
Private Sub Form_Load()
WebBrowser1.Silent = True '这样就可以屏蔽了。。
End Sub
或者
Private Sub webbrowser1_DownloadBegin()
webbrowser1.Silent = True
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询