Create WebBrowsers inside the application and not outside the app, anyone know?

Alpha_AI
Alpha_AI used Ask the Experts™
on
Hi,

How does one create webbrowsers dynamically inside the application im building .
I need them to open every time I click on new search.
I dont want a ie browser to open, i want a webbrowser to open inside my app and
be contained inside my app.

I thought it might be something like

var
   flag : OleVariant;
   WebBrowser : TWebBrowser;

begin
WebBrowser := TWebBrowser.Create(self)
WebBrowser.Parent := self;
flag := navOpenInNewWindow;
WebBrowser.Navigate('www.hotmail.com',flag);
end;

The above code opens up a browser outside of my application and not inside.
Anyone know?
Cheers

Ben
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
if you use twebbrowser from d5 you get a subset of i.e. in your form but if someone
shift clicks a link an instance of i.e. will pop up with the new page.
so you will have to deal with loads of stuff like that.

you could do a search for html viewers which are like a trichedit but instead with html.
put a button and a panel on a form.
Declare a variable
FWebBrowser : TWebBrowser;

On the button Click even put the following...

procedure TForm1.Button1Click(Sender: TObject);
var
 wTargetFrameName : OleVariant;
 wPostData        : OleVariant;
 wHeaders         : OleVariant;
 wFlags           : OleVariant;
 wURL             : WideString;
begin
  FWebBrowser := TWebBrowser.Create(Self);
  FWebBrowser.Align          := alClient;
  FWebBrowser.Silent         := True;
  FWebBrowser.MenuBar        := False;
  FWebBrowser.AddressBar     := False;
  FWebBrowser.StatusBar      := False;
  FWebBrowser.TheaterMode    := False;
  FWebBrowser.ToolBar        := -1;
  wURL                       := 'www.yahoo.com';
  wFlags := 2;
  Panel1.InsertControl(FWebBrowser);
  FWebBrowser.Navigate(wUrl, wFlags, wTargetFrameName, wPostData, wHeaders);
end;

Dont forget to free it when your done...

Cheers
the following worked fine for me (D7)

Web := TWebBrowser.Create( Self );
Web.ParentWindow := Form1.Handle;
Web.Navigate( 'http://www.google.com' );
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

if you need more control and want to try a basic browser, theres a free ThtmlLite component at:
http://www.pbear.com/


Regards
Steve
Commented:
Check http://www.euromind.com/iedelphi/ for (almost) everything about using IE from Delphi
Wayne BarronAuthor, Web Developer
Top Expert 2009
Commented:
[BlackMan] is right on the money.
Use TEmbeddedWB, Great I use it in 2 commercial apps, with tons of success.

Take Care
Wayne

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial