WebBrowser1 :=TWebBrowser.Create(Application);
WebBrowser1.Align := alClient;
WebBrowser1.Visible :=true;
WebBrowser1.Navigate(ExtractFilePath(Application.ExeName)+'framelayout.htm');我想动态的建立就是不行,如果在设计WebBrowser把参数定好就,在form show的时候  WebBrowser1.Navigate(ExtractFilePath(Application.ExeName)+'framelayout.htm')可以运行.请各位大虾帮帮忙,看看是啥问题?

解决方案 »

  1.   

    在delphi中没有试过,看是不是这个问题:ExtractFilePath(Application.ExeName)得到的路径像这样:c:\test\而 WebBrowser1.Navigate 方法需要的URL像这样:file:///c:/test/a.htm
      

  2.   

    把路径写成file:///c:/test/a.htm这样以后提示找不到路径,但是按照我的写法,我在
    procedure TForm1.FormCreate(Sender: TObject);
    begin
     WebBrowser1.Navigate(ExtractFilePath(Application.ExeName)+'framelayout.htm');
    end;是可以执行的,没有问题,我现在的需求是要控件动态生成,所以出问题.
      

  3.   

       
       FBrowser := TWebBrowser.Create(nil);
       if Assigned(FBrowser) then
        begin
          TOleControl(FBrowser).Parent := Self;  // Set parent      if Length(AUrl) > 0 then
            FBrowser.Go(AUrl)
          else FBrowser.GoAboutBlank;
        end;
    我怀疑你没有把Browser显示出来,上面代码试试
      

  4.   

    有什么事儿mail给我,我没QQ,
    [[email protected]][email protected][/email]