问题描述
我正在尝试更改WPF WebBrowser控件中的值(开始时间),但无法执行。
var document = (IHTMLDocument3)WBMain.Document;
尝试了许多方法,但没有任何效果:
document.getElementById("start_time").innerText = "11:30";
-不起作用。这会更改字段中的值,但是由于不会触发下拉onchange,因此在提交表单时不会选择推送的值。而是选择旧值。
document.getElementById("start_time").setAttribute("value","11:30");
-不起作用。
document.getElementById("start_time").setAttribute("SelectedIndex",2);
-不起作用。
document.getElementById("start_time").setAttribute("SelectedIndex","2");
-即使索引作为字符串传递也不起作用。
控件的检查元素HTML代码:
<span tabindex="0" aria-controls="start_time-popup-list" aria-owns="start_time-popup-list" aria-label="3:00" role="combobox" aria-expanded="false" aria-haspopup="true" id="start_time" class="zm-select-span__inner">3:00</span>
非常感谢您的帮助。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)