VS2005 Vb.Net and webbrowser control

G

Guest

In a windows application we have a webbrowser control and we want to change
the selected item of a select or combobox inside the webbrowser control. We
know how to change the value of a textbox with the .innertext property but
how to do the same with the select or combobox html control ?

Thanks in advance
 
G

Guest

Hi,

If you want to change text of an item in a select do the following:
WebBrowser.Document.All["elementId"].Children[index].InnerText = "New Text";

You can also select an item using SetAttribute method of the HtmlElement
class:
WebBrowser.Document.All["elementId"].Children[index].SetAttribute("SELECTED", "true");

Hope this helps
 

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