问题
I am using the code:
((GeckoSelectElement) geckoWebBrowser1.Document.GetElementById("OA0001_dob_month")).Value = "Jul";
But its not working. How to select a value in a selectbox in geckofx c# without using the jscontext?
回答1:
To select a value by index:
var document = GeckoWebBrowser1.Document;
var selectElement = (GeckoSelectElement)document.GetElementById("OA0001_dob_month");
selectElement.SelectedIndex = 2;
来源:https://stackoverflow.com/questions/33259192/fill-a-select-box-using-geckofx-c-sharp