问题
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