1. Create a new class and use the class to obtain the WebBrowser element.
public HtmlElement GetElement_Name(WebBrowser wb,= HtmlElement GetElement_Id(WebBrowser wb, = HtmlElement GetElement_Index(WebBrowser wb,= HtmlElement GetElement_Form(WebBrowser wb,= CheckExistElement_Form(WebBrowser wb, = (e == Write_value(HtmlElement e, Btn_click(HtmlElement e,
Element el =), dt. rows [] [= (IHTMLElementCollection) doc2.all. tags (); IHTMLElementCollection = (IHTMLElementCollection) doc2.all. tags (); IHTMLElement elementsex = (IHTMLElement) input. item (, = (dt. rows [] []. toString () ====== IHTMLElement elementgroup_id = (IHTMLElement ). item (, = SelectElementgroup_id.value =]. raiseEvent (IHTMLDocument2 doc11 = (IHTMLDocument2) IDRWebBrowser. document. window. frames [=;
// If You Want To execute element events, such as onchange events, onclick events, and onblur events, you can use either of the following methods:
WebBrowser executes Javascript in the dom in two ways:
1. IDRWebBrowser. document. all ["B _year"]. raiseEvent ("onblur"); // execute the onblur event whose element name is 'B _ year'. If it is an onclick event, change it.
2. IDRWebBrowser. document. invokeScript ("changeDiseaseid1", new object [] {InputElementselDisease_1}); // execute the changeDiseaseid1 method, which is followed by parameters. There are many online explanations, I suggest using the first method, and the first one is easy to use.