Pregunta: | 68176 - OPTION STRICT ON NO PERMITE EL ENLACE... WEBBROWSER VB 2010 |
Autor: | Gilberto Rojas |
Estoy haciendo un pequeño explorador en Visual Basic 2010 y necesito ajustar el zoom a voluntad de WebBrowser. Buscando una solucion en Internet consegui un codigo que me da el siguiente error "Option Strict On no permite el enlace en tiempo de ejecucion" este es el codigo: Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click 'If for any reason we encounter any errors, we just want to ignore them. On Error Resume Next 'Declare an ActiveX instance for the webbrowser Dim wbInstance As Object = WebBrowser1.ActiveXInstance 'Execute the zoom. The third parameter, the nubmer is the one which tells the ActiveX instance how far to zoom in on the browser, in this case by 50%. wbInstance.ExecWB(Exec.OLECMDID_OPTICAL_ZOOM, ExecOpt.OLECMDEXECOPT_DONTPROMPTUSER, 50, DBNull.Value) End Sub Private Enum ExecOpt 'A few options for what we want to do, using ActiveX 'This option will just carry out the default action OLECMDEXECOPT_DODEFAULT = 0 'This option will prompt the user before carrying out an action OLECMDEXECOPT_PROMPTUSER = 1 'This option will not prompt the user before carring out an action OLECMDEXECOPT_DONTPROMPTUSER = 2 'This option will show help OLECMDEXECOPT_SHOWHELP = 3 End Enum Private Enum Exec 'This is the main ActiveX declaration for the webbrowser Zoom OLECMDID_OPTICAL_ZOOM = 63 End Enum El error se me da en: wbInstance.ExecWB(Exec.OLECMDID_OPTICAL_ZOOM, ExecOpt.OLECMDEXECOPT_DONTPROMPTUSER, 50, DBNull.Value) Anduve buscando en Internet y no consegui nada cerca de mi comprension. Uso Windows 8 Gracias a los que puedan ayudarme. |