webbrowser

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?
 
G

G Himangi

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

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top