WebBrowser中HTML的js与winform中其他的窗体调用。。。
这是vb代码:
Imports System.Runtime.InteropServices
Imports System.Security.Permissions
'下面尖括号中也不能少也,c#为中括号。
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")> <System.Runtime.InteropServices.ComVisibleAttribute(True)> _
Public Class frmPmain
Private Sub frmPmain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.ObjectForScripting = Me'此句不可少也
End Sub
Public Sub qtshow()
frmPqt.Show()
End Sub
End Class
下面是js:
<img style="vertical-align:bottom" src="images/1.gif" name="img01" width="20%" border="0" id="title01" onMouseOver="MM_swapImage('img01','','images/3.gif',1)" onMouseOut="MM_swapImgRestore()" onclick="window.external.qtshow()">
直接诶从项目里复制的。主要是onclick="window.external.qtshow()"
Imports System.Runtime.InteropServices
Imports System.Security.Permissions
'下面尖括号中也不能少也,c#为中括号。
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")> <System.Runtime.InteropServices.ComVisibleAttribute(True)> _
Public Class frmPmain
Private Sub frmPmain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.ObjectForScripting = Me'此句不可少也
End Sub
Public Sub qtshow()
frmPqt.Show()
End Sub
End Class
下面是js:
<img style="vertical-align:bottom" src="images/1.gif" name="img01" width="20%" border="0" id="title01" onMouseOver="MM_swapImage('img01','','images/3.gif',1)" onMouseOut="MM_swapImgRestore()" onclick="window.external.qtshow()">
直接诶从项目里复制的。主要是onclick="window.external.qtshow()"