webbrowser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need create some application which will use webbrowser control and make
some action with content.
It should be something like this.
1) open in webbrowser page - http://msdn.microsoft.com
2) in code (!) I should put something in search text box some string
"C# webbrowser control"
3) make click event on button with text "Search"

how I can do something like that? How I can work with content and fill some
forms
which we have in webbrowser control?
 
HtmlElement he = webBrowser1.Document.All.GetElementsByName(name)[0];
he.SetAttribute("value", searchStr);

To click a button use Invokemember("Click")

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
 
G Himangi said:
HtmlElement he = webBrowser1.Document.All.GetElementsByName(name)[0];
he.SetAttribute("value", searchStr);

To click a button use Invokemember("Click")

thank you. it is very helpful.
I have question about javascript.

So now I can run any jscript which page have by this code
webBrowser1.Document.InvokeScript("ShowMessage");

but How I can add some jscript to this page?

I have tried
webBrowser1.DocumentText += "<script language=javascript >function
NewMessage() { alert('text'); }</script>";
webBrowser1.Document.InvokeScript("NewMessage");

but it doesn't work.
 
Back
Top