本人学了8个小时的delphi很多东西不懂,应该是这段代码了。高手们注意了。得详细的说说,因为你少打一个分号我都不会补。
procedure TFrmMain.ActiveWebChange;
Var
  WebForm: TFrmWeb;
begin
  WebForm := CurrentWebForm;
  If WebForm = Nil Then Exit;  //改变地址栏
  cobAddress.Url := WebForm.WebUrl;  PageControl.TabIndex := PageControl.Tabs.IndexOfObject(WebForm);
//  WebForm.ToolButton.Down := True;//  IeTravelLog.Webbrowser := WebForm.WebBrowser;
//  IeTravelLog.Connect;  FavoritesMenu.EmbeddedWB := WebForm.WebBrowser;  //刷新进度条
  RefreshProgress(WebForm.Progress);  WebForm.WebBrowser.SetFocusToDoc;
end;

解决方案 »

  1.   

    不至于少打一个分号就??………………算了,反正分不分的也无所谓,给你说个大概思路吧。。function Zh(Url:string):boolean;
    beign
      Result:=false;
      For i:=1 to Length(Url) do
        if Ord(Url[i])>127 then
        begin
          Result:=true;
          exit;
        end;
    end;
    然后,在需要跳转的地方写上:if Zh(WebForm.WebUrl) then
      //跳转语句,百度搜索地址为:('http://www.baidu.com/s?wd=' + WebUrl)  <--这里的WebUrl既然包含了汉字,就应该是关键字啦
    else begin
      //去网页
    end;
    //至于怎么跳转。。别问我。。我不知道。。谁知道你用的什么组件