在线急等!小妹我又遇到麻烦事情了!!高手快快来帮忙吧!看看这段程序啊!拜托了/
private void browser_DocumentComplete(object sender, AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
mshtml.IHTMLDocument3 doc = this.browser.Document as mshtml.IHTMLDocument3;
mshtml.IHTMLElementCollection collection = doc.getElementsByTagName("div");
foreach(mshtml.IHTMLElement element in collection)
{
if(element.className == "editable")
{
((mshtml.HTMLElementEvents2_Event)element).onclick +=
new mshtml.HTMLElementEvents2_onclickEventHandler(this.element_onClick);
}
}
}
private bool element_onClick(mshtml.IHTMLEventObj e)
{
System.Windows.Forms.OpenFileDialog of = new OpenFileDialog();
if(System.Windows.Forms.DialogResult.OK == of.ShowDialog())
{
return true;
}
return false;
}
我的目的是在单击文本筐的时候.弹出一个对话筐.这个代码可以实现.但是
只可以实现一次.也后我点击就没反应了.(用的是mshtml和web Browser).
快救我!