How can I navigate a webbrowser programmatically?

我只是一个虾纸丫 提交于 2019-11-28 11:34:48

问题


I want to Navigate my web browser with a defined function like:

webbrowser1.navigate (my defined function);

This webbrowser is defined in a user control so that any one can change its default web page

How can I define a function by which the path sets?


回答1:


Try following code:

HtmlElementCollection ele = this.webBrowserControl.Document.GetElementsByTagName("Form");  

foreach(HtmlElement currentElement in ele)
{
    currentElement.InvokeMember("submit");
}

OR

webbrowser.Document.All["ID OF ELEMENT"].InvokeMember("click");

Hope Its helpful.



来源:https://stackoverflow.com/questions/15847916/how-can-i-navigate-a-webbrowser-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!