|
■No60566 (魔界の仮面弁士) に追記
> CallByName(WebBrowser1.ActiveXInstance, "[DispID=502]", CallType.Method, _
> OLECMDID_OPTICAL_ZOOM, 0, pvaIn, pvaOut)
別案として。
Private Sub TrackBar1_ValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TrackBar1.ValueChanged
Dim wb As Object = WebBrowser1.ActiveXInstance
If wb IsNot Nothing Then
Dim asm As Assembly = Assembly.GetAssembly(GetType(Form))
Dim t As Type = asm.GetType("System.Windows.Forms.UnsafeNativeMethods+IWebBrowser2")
Const OLECMDID_OPTICAL_ZOOM As Integer = 63
Dim pvaIn As Object = TrackBar1.Value
Dim params() As Object = {OLECMDID_OPTICAL_ZOOM, 0, pvaIn, IntPtr.Zero}
t.GetMethod("ExecWB").Invoke(wb, BindingFlags.InvokeMethod, Nothing, params, Nothing)
End If
End Sub
|