Dim txtUser_Element As HtmlElemen
Dim txtPass_Element As HtmlElement
Dim btEntrar_Element As HtmlElement
'Capturar elemento por el ID
txtUser_Element = WebBrowserEx1.Document.GetElementById("txtUsuario")
txtPass_Element = WebBrowserEx1.Document.GetElementById("txtPassword")
btEntrar_Element = WebBrowserEx1.Document.GetElementById("btnEntrar")
'Por posición del tipo elemento-> .Document.GetElementsByTagName("INPUT").Item(8)
'Informar txt a traves del atributo value
txtUser_Element.SetAttribute("value", tdbConfig.SegurosVF.userShop)
txtPass_Element.SetAttribute("value", tdbConfig.SegurosVF.passShop)
'llamada al evento click
btEntrar_Element.RaiseEvent("onclick")
'-------------------------------------
'Capturar contenido txt a través del atributo value
Dim txtCod_Element As HtmlElement
txtCodSAP_Element = WebBrowserEx1.Document.GetElementById("txtCod")
msgbox(txtCod_Element.GetAttribute("value"))
'--------------------------------------
'Pulsar botón mediante InvokeMember
Dim btBuscar_Element As HtmlElement
btBuscar_Element = WebBrowserEx1.Document.GetElementById("btnBuscar")
btBuscar_Element.InvokeMember("click")
'--------------------------------------
'Capturar contenido del desplegable combo del indice seleccionado
Dim cmbFact_Element As HtmlElement, i as integer
cmbFact_Element = WebBrowserEx1.Document.GetElementById("cmbFact")
i = cmbFact_Element.GetAttribute("selectedindex")
msgbox(cmbFact_Element.Children(i).InnerText)
'Seleccionar indice del desplegable combo
Dim cmbProducto_Element As HtmlElement
cmbProducto_Element = WebBrowserEx1.Document.GetElementById("cmbProducto")
cmbProducto_Element.SetAttribute("selectedindex", 3)
cmbProducto_Element.RaiseEvent("onchange")
'---------------------------------------
'ZOOM
Private Enum Exec
OLECMDID_OPTICAL_ZOOM = 63
End Enum
Private Enum ExecOpt
OLECMDEXECOPT_DODEFAULT = 0
OLECMDEXECOPT_PROMPTUSER = 1
OLECMDEXECOPT_DONTPROMPTUSER = 2
OLECMDEXECOPT_SHOWHELP = 3
End Enum
Dim Res As Object = Nothing
Dim MyWeb As Object
MyWeb = Me.WebBrowserEx1.ActiveXInstance
MyWeb.ExecWB(Exec.OLECMDID_OPTICAL_ZOOM, _
ExecOpt.OLECMDEXECOPT_DONTPROMPTUSER, 50, IntPtr.Zero)
'Cambiar tamaño de la fuente
-----------------------------------
WebBrowserEx1.Document.Body.Style = "font-size:11px;"