如何更改组合框;选择索引“;Windows Phone Silverlight上的WebBrowser?

如何更改组合框;选择索引“;Windows Phone Silverlight上的WebBrowser?,silverlight,windows-phone-7,combobox,browser,selectedindex,Silverlight,Windows Phone 7,Combobox,Browser,Selectedindex,在WebBrowser中有此页面()和“destinationCity”组合框。在VB.NET中,我使用: Dim DestinationComboBox As HtmlElement = MainWebBrowser.Document.All.Item("destinationCity") DestinationComboBox.SetAttribute("selectedindex", 1) 要更改组合框,请选择索引,但在Silverlight中(在此WebBrowser中),只有Invo

在WebBrowser中有此页面()和“destinationCity”
组合框
。在VB.NET中,我使用:

Dim DestinationComboBox As HtmlElement = MainWebBrowser.Document.All.Item("destinationCity")
DestinationComboBox.SetAttribute("selectedindex", 1)
要更改组合框,请选择索引,但在Silverlight中(在此
WebBrowser
中),只有
InvokeScript
函数。。如何使用
InvokeScript()
更改所选索引? 我试过了

InvokeScript("eval", "document.getElementById('destinationCity').selectedindex = 4")

但是它不起作用。。救命啊

如果您使用Chrome Developer Tools或FireBug对给定页面执行以下JavaScript,您会发现它在桌面浏览器中不起作用:

document.getElementById('destinationCity').selectedindex = 4
JavaScript和
selectedIndex
属性区分大小写。以下工作:

document.getElementById('destinationCity').selectedIndex = 4

你的两个例子有什么不同?我怎样才能让代码在我的应用程序中工作呢?解决了,我用了“selectedIndex”而不是“selectedIndex”,它工作得非常好!谢谢!(也许你必须更正你的答案)