开发者

How to call onkeypress event in a html page (Delphi)

How c开发者_高级运维an i call onkeypress event of a textarea control in a html page using WebBrowser?


This is a way with late binding:

procedure TBrowserPageIE.Test;
var
  doc : OleVariant;
  el  : OleVariant;
  v   : OleVariant;
begin
  if FBrowser.Document <> nil then begin
    doc := FBrowser.Document;
    el := doc.getElementById('myTextArea');
    el.FireEvent('onkeypress', v);
  end;
end;

Please add some code for nil/exception handling.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜