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')可以运行.请各位大虾帮帮忙,看看是啥问题?
WebBrowser1.Align := alClient;
WebBrowser1.Visible :=true;
WebBrowser1.Navigate(ExtractFilePath(Application.ExeName)+'framelayout.htm');我想动态的建立就是不行,如果在设计WebBrowser把参数定好就,在form show的时候 WebBrowser1.Navigate(ExtractFilePath(Application.ExeName)+'framelayout.htm')可以运行.请各位大虾帮帮忙,看看是啥问题?
procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.Navigate(ExtractFilePath(Application.ExeName)+'framelayout.htm');
end;是可以执行的,没有问题,我现在的需求是要控件动态生成,所以出问题.
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显示出来,上面代码试试
[[email protected]][email protected][/email]