现在很多使用html页面形式的界面设计,原理是什么?是利用Twebbrower么?如何和页面中的数据进行交互啊?

解决方案 »

  1.   

    引用別人的答案:OnBeforeNavigate2 Event 中写代码判断连接名,根据不同的连接名执行不同的程序段! //根据连接找菜单click;
    procedure Tuejxcf.WebBrowserBeforeNavigate2(Sender: TObject;
      const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
      Headers: OleVariant; var Cancel: WordBool);
    var hintname:string;
        i,j,k:integer;
    begin
      hintname:=extractfilename(url);
      cancel:=true;
      for i:=0  to mainmenu.Items.Count-1 do
       if mainmenu.Items.Items[i].Hint=hintname then
        begin
         mainmenu.Items.Items[i].Click;
         exit;
        end else
         for j:=0 to uejxcf.Menu.Items[i].Count-1 do
           if mainmenu.Items.Items[i].Items[j].Hint=hintname then
            begin
             mainmenu.Items.Items[i].Items[j].Click;
             exit;
            end else
             for k:=0 to uejxcf.Menu.Items[i].Items[j].Count-1 do
               if mainmenu.Items.Items[i].Items[j].Items[k].hint=hintname then
               begin
                mainmenu.Items.Items[i].Items[j].Items[k].Click;
                exit;
               end
    end;