delphi中调用html界面时,如何控制html中button的click事件!

解决方案 »

  1.   

    看看Webbrowers的源代码,如果找不到那也就没办法了。
      

  2.   

    var 
       ove:olevariant;
       i:integer;
    begin
       ove:=webbrowser1.oleobject.document.forms.item(0).element;
       for i:=0 to ove-1 do
       begin
         if (ove.item(i).tagName='INPUT') and (ove.item(i).value='hello') then
            ove.item(i).click;
       end;
    end;或
    html:
    <input type=button value="Hello" onclick='...' ID="HClick">
    delphi:
    WebBrowser1.OleObject.Document.getElementByID('HClick').Click();
      

  3.   

    你选建好一个含有一个带有button的页面。
    在delphi中用webbrowser打开,然后你可以通过以上的两种方法均可呀。
    我觉得上面写得蛮清楚了呀。