How to iterate DOM nodes in Delphi Chromium Embedded without use of anonymous method?

雨燕双飞 提交于 2019-12-13 18:43:36

问题


Delphi Embedded Chrome

Due to my limited skill, I cannot figure out how to do the same thing in Delphi 7, as it doesn't support an anonymous method!


回答1:


procedure TheProcThatHandlesItAll(const doc: ICefDomDocument)
var
  q: ICefDomNode;
begin
  // "q" is the ID of the text input element
  q := doc.GetElementById('q');
  if Assigned(q) then
    q.SetElementAttribute('value', 'Hello, world');
end

procedure TMainForm.actDomExecute(Sender: TObject);
begin
  crm.Browser.MainFrame.VisitDomProc(TheProcThatHandlesItAll);
end;


来源:https://stackoverflow.com/questions/12865242/how-to-iterate-dom-nodes-in-delphi-chromium-embedded-without-use-of-anonymous-me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!