标签:
查找webBrowser控件页面里的控件
HtmlElement btnElement = this.webBrw.Document.GetElementById("txtnum");
if (btnElement != null)
{
string a = btnElement.InnerText;
string b = btnElement.OuterText;
}
调用webBrowser控件页面里的JS
需要引用.Net
using mshtml;
IHTMLDocument2 doc = (IHTMLDocument2)webBrw.Document.DomDocument;
IHTMLWindow2 win = (IHTMLWindow2)doc.parentWindow;
win.execScript("IfDY()", "javascript");
给webBrowser控件页面里的button单击事件重新赋事件
HtmlElement btnElement = this.webBrowser1.Document.GetElementById("btn180");
if (btnElement != null)
{
btnElement.Click += new HtmlElementEventHandler(button2_Click);
}
标签:
原文地址:http://www.cnblogs.com/hupengtao/p/5790403.html