ComboBox to HtmlElement ??

Hi All,

I have an application that is running a WebBrowser control.

In my app I have a comboBox that has all the states in it .. Alabama, Alaska, etc. ...

I simply want to set the drop down in the webBrowser to the same selected state in my app .. how can I do this...

Apparently there is no HtmlElement for drop downs ... I have been trying InnerText to no avail!

SetAttribute Maybe

thanks,

Paul



Answer this question

ComboBox to HtmlElement ??

  • Latso

    No one

    Just need to set the selection of a drop down menu in my browserControl .. Can this be done

    thanks,

    Paul


  • danadanny

    I got it..

    Here is the code just in case someone else needs it someday :)

     

    HtmlElement stateDrop = doc.GetElementById("returnState");

    foreach (HtmlElement a in stateDrop.Children)

    {

    if (a.InnerText.ToLower() == myAppComboBox.Text.ToLower())

    {

    a.SetAttribute("selected", "selected");

    }

    }


  • ComboBox to HtmlElement ??