How to click an item in a listbox via Webbrowser in Visual Studio 2005 C# Express

C

cweeks

I use the InvokeMember("Click") method of HtmlElement to click a button
in a web page using the Webbrowser control that is new in VS 2005 C#
Express. Now I need to be able to select a member of a list before
clicking the button. Using InvokeMember("Click") on the HtmlElement
does not cause that list item to be selected. How do I select that
list item from C# the way a user would with the left mouse button?
 
C

cweeks

It appears (I know next to nothing about HTML) that in the <option> tag
the string "selected" (without the quotes) appears for the items in the
list that are selected so i am going to try removing this string from
any list item that contains it and inserting it into the one that I
want to select from C#. I think that will work.
 
C

cweeks

Well, any attempt to change the text in the OuterHtml field cause a COM
exception in Interop services. :-(
 

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