Home
> Uncategorized > Iterating HTMLSelectElement options in C# And VB.NET
Iterating HTMLSelectElement options in C# And VB.NET
If you want to list all the values of options in a HTML drop down list, from a webbrowser control in VB.NET or C#, here’s how to do it:
Dim hoeDest As HTMLOptionElement
For iDest = 0 To hseDestinations.options.length – 1
hoeDest = hseDestinations.options.item(iDest)
tbOutput.Text += hoeDest.value
Next iDest
Or in C#
for (var iDest = 0; iDest <= destinationSelect.Children.Count – 1; iDest++)
{
var hoeDest = (HTMLOptionElement)destinationSelect.Children[iDest].DomElement;
tbOutput.Text += hoeDep.value;
}
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback