问题描述
我想知道如何在带有 delphi 的 TWebbrowser 中将属性“禁用”添加到网页中的文本类型字段。 我使用此代码,但即使值被修改,属性“disabled”和“ReadOnly”都不会对字段产生任何影响。 感谢您的帮助和建议
procedure TForm1.Button1Click(Sender: TObject);
var
col: IHTMLElementCollection;
el: IHTMLInputElement;
begin
col := (Webbrowser1.Document as IHTMLDocument3).getElementsByName('input_name');
if col.length <> 0 then
begin
el := col.item(0,0) as IHTMLInputElement;
el.value := 'new_value';
el.disabled := True;
el.readOnly := True;
end;
end;
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)