使用webbrowser控件自动填表单,如何模拟onblur事件。
<INPUTonblur="this.className='inp1';ADD_Jeu_S(this);"class=inp1onfocus="this.classNam...
<INPUT onblur="this.className='inp1';ADD_Jeu_S(this);" class=inp1 onfocus="this.className='inp1m'" onkeypress=digitOnly(event) maxLength=9 size=6 name=jeuM_32_347>我需要用C#代码自动触发这个文本框的onblur事件。需要怎么做?
展开
1个回答
展开全部
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
HtmlDocument htmlDoc = webBrowser1.Document;
htmlDoc.Click+=new HtmlElementEventHandler(htmlDoc_Click);
}
private void htmlDoc_Click(object sender, HtmlElementEventArgs e)
{
HtmlDocument doc = sender as HtmlDocument;
HtmlElement ele = doc.GetElementFromPoint(e.ClientMousePosition);
MessageBox.Show(ele.OuterHtml);
}
{
HtmlDocument htmlDoc = webBrowser1.Document;
htmlDoc.Click+=new HtmlElementEventHandler(htmlDoc_Click);
}
private void htmlDoc_Click(object sender, HtmlElementEventArgs e)
{
HtmlDocument doc = sender as HtmlDocument;
HtmlElement ele = doc.GetElementFromPoint(e.ClientMousePosition);
MessageBox.Show(ele.OuterHtml);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询