TWebBrowser in Delphi 2009 [Edit]

I'm having a strange problem with TWebBrowser in Delphi 2009.

If you take a TWebBrowser from the palette, put it on a form, then it works :)

However, if you put the TWebBrowser control and put it on a form, and then open the form as a child window, it does not work. By 'child' window I don't mean anything to do with MDI; rather I mean opening one form almost as a control onto another (in order words, a Petzold 'child'). Code showing how this is done is posted below.

This has not been a problem in earlier versions of Delphi. Something has changed. If someone could let me know what I can do to get around this I'd be grateful. My efforts today have failed to find a solution.

This code opens the window correctly, but the ouoWeb TWebBrowser control does absolutely nothing. Call navigate(...) and no exception is raised but it does nothing.

myWeb := TCCBase.create(myOwningForm);
myWeb.aPanel := myOwningForm.myPanel;
myWeb.snapToPlace(); // align and make visible

// web browser will now do nothing, but will work if you open TCCBase as an ordinary floating TForm

	TCCBase = class(TForm)
		procedure CreateParams(var Params: TCreateParams); override;
		ouoWeb: TWebBrowser;
		aPanel: TPanel;
		procedure snapToPlace();

procedure TCCBase.CreateParams(var Params: TCreateParams);
	// Make this window a child window. It makes no difference if this code is in or out := Params.Style or WS_CHILD;
	inherited CreateParams(Params);

procedure TCCBase.snapToPlace;
	// Line the window up with the parent (usually a panel)
	align := alClient;
	borderstyle := bsNone;
	BorderIcons := [];
	parent := aPanel;
	position := poDefault;
	visible := TRUE;

Edited by: Pete Williams on Mar 17, 2009 11:36 AM
3/17/2009 6:37:11 PM
embarcadero.delphi.vcl.using 2297 articles. 1 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 59

It turns out this problem is timing related, and it's a difference in Delphi 2009.

What you have to do is wait for the TWebBrowser control to be instantiated. From the showWindow event, the first time this event fires, I post another message to the child window. On this message received I can safely navigate to the web page.

If you try to navigate() before this it doesn't work.
3/18/2009 1:05:19 PM

Similar Artilces:

Convert Delphi 7 to Delphi 2009 [Edit]
Hi! Please, I have a code done in Delphi 7... Now I want to convert Delphi 7 to Delphi 2009 but I'm having problems when compile the code. Error message: +[DCC Fatal Error] Far.dpr(9): F2063 Could not compile used unit 'System.pas'+ Please can somebody help me? Source Download (349KB): Mirror Source Download: Password: delphi Thank u so much! (sorry for my bad english, it is not my native language) Edited by: loquax loquax on Jul 15, 2009 12:24 PM Sorry, bu...

can i use delphi 2007 bpls in delphi 2009
can i use delphi 2007 bpls in delphi 2009 ? "Gaetan SIRY" skrev i meddelelsen > can i use delphi 2007 bpls in delphi 2009 ? No. -- Finn Tolderlund The compatiblity between D2006 and D2007 was unique. Normaly they can't be compatible because new version enhance/change the API. And D2009 defines String = Unicode where older version has String = Ansistring so D200x/Dx-BPL are 200% incompatible with D2009. ...

Delphi 2010 produces much larger binaries than Delphi 2009 [Edit]
When I compile my project with Delphi 2010 the resulting executable is about 30% larger than the one compiled with Delphi 2009. Both binaries are compiled with the same source code and project options. The size of individual DCU files increases by 5-20%. Has anybody experienced similar results? Has anybody an idea what could cause this? It surprises me, as the changes in syntax and VCL have not been that big. Best regards, Joachim Edited by: Joachim Marder on Sep 25, 2009 6:07 AM "Joachim Marder" wrote in message > When I compi...

Delphi 5 To Delphi 2009
I upgraded to Delphi 2009 from D5. The install says I can install Delphi and/or C++. Delphi installed OK but I see nothing of C++. What am I missing or does my upgrade not include C++? Thanks It depends on what you bought. If you bought Delphi 2009 only, that's what you get. If you bought Delphi 2009 and C++ Builder 2009 you get both. My guess is you got Delphi 2009 only. The simplest way to verify is look your invoice - it should say I would think. You could also go to, login, then click on my registered products. There will be a textual description of...

Delphi 4 to Delphi 2009
Hello, Thanks to all who answered my previous question. That was a great help. And atlast our client agreed to upgrade our delphi version from 4 to Delphi 2009. *Sigh*. But before that, I need to give the estimation and cost regarding the migration to delphi 2009. Can anyone tell me is there any tool to migrate from delphi 4 to delphi 2009 or just I need to compile our Delphi 4 application in Delphi 2009. I have read from the delphi 2009 feature matrix that Delphi 1 through Delphi 2007 import is possible in delphi 2009. But i am not that sure considering the size of our application. ...

Issue with TWebBrowser(Delphi 2009) when using explorer 9
Hi, I am facing a strange issue when using TWebBrowser with Delphi 2009 and Explorer 9. What I am trying to do is loading a html page and then printing it. But if Explorer version is 9, then even the scroll bar of the window get printed and also if the document is more than one page, only what is visible at the window is getting printed !!! this issue is only reproducable if explorer 9 used along with delphi 2009. other versions of explorer work fine. Is this because delphi 2009 is not compatible with Explore r 9 ????? Code is as below. WebBrowser1.ControlInterface.ExecWB(OLECMDID_PRINT...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: PS: Bankinssoftware for Develpoers (Germany only) El 26/10/13 21:38, A...

Converting Delphi 2007 Indy 10.2.3 to Delphi 2009 Indy 10.5.5 [Edit]
Hello, I am currently attempting to port over a Delphi 2007 project that uses Indy 10.2.3 (very successfully) to Delphi 2009 and Indy 10.5.5 (I just got the latest development build this morning). I think I am running into an encoding issue, but am not sure. Specifically, IDHTTP with SSL calls an old CGI and the CGI returns a .zip file and I then save it to the disk. In 2007 and before this worked perfectly. In 2009, it is not. Here is the examples of the 2 different results (though cut way short in the post) I am getting back: 2007: 'PK'#3#4#$14#0#0#0#8#0'rLQ9žrPb€'#0...

Delphi 7 to Delphi 2009 conversion
Hello group, What do I need to do to comile the following code in D2009. Compiler error after the Else E2010: Incompatible Types 'AnsiChar' and 'Char' if isUnicode then SearchHandle := FindFirstFilew( PWideChar( fn ), FindDataW ) else SearchHandle := FindFirstFile( PAnsiChar( Ansistring( fn ) ), FindDataA ); <<<<<compiler error in the above line >>>>>>>>>>> Regards, Bryan > What do I need to do to comile the following code in D2009. > Compiler error after the Else > E2010: Incompati...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

is there a Delphi 2007
Would be nice to have a bundle of the latest Delphi packages. Gilbert Padilla wrote: > Would be nice to have a bundle of the latest Delphi packages. > I expect Delphi 2007 will only be on sale until the full RAD Studio 2009 edition is published, including Delphi W ...

Delphi 2009 alongside Delphi 2007
Hi all, I am about to install Delphi 2009 on the same development system as Delphi 2007, before I embark is there anything I should be aware of so as to not break my Delphi 2007 installation and projects ? Thanks JT John Taylor wrote: > Hi all, > > I am about to install Delphi 2009 on the same development system > as Delphi 2007, before I embark is there anything I should be aware > of so as to not break my Delphi 2007 installation and projects ? As long as you install into a separate folder there is no problem with the two versions getting into each other...

Upgrading to Delphi 2009 from Delphi 5
I've decided it's time to upgrade to Delphi 2009 Professional from my current Delphi 5 Professional which (according to the FAQ) makes me eligible for the upgrade pricing. However, I'd just like to clarify how this process works. My concern is that my Delphi 5 is not registered on the CodeGear site and this doesn't seem to be possible as far as I can tell. When installing the trial I noticed that Delphi 2009 registers itself with your CodeGear account so does this mean that the previous version must be registered there to verify you own a Professional edition? I plan to o...

Delphi 2007 to Delphi 2009 Conversion
CharArrayPtr = ^CharArray; CharArray = array[0..MaxInt-1] of Char; How to convert to Delphi 2009? Bill Bill Miller wrote: > CharArrayPtr = ^CharArray; > CharArray = array[0..MaxInt-1] of Char; > > How to convert to Delphi 2009? > > Bill it depends heavelly on how it is used fearther down in your project and what you want to convert it to. I you want to simple convert the declarations ignoring UNicode altogether then the only think you have to change is the CharArray declaratin from a Char to an AnsiChar eg CharArrayPtr = ^CharArray; CharArray =...

Web resources about - TWebBrowser in Delphi 2009 [Edit] - embarcadero.delphi.vcl.using

Getting TWebBrowser on iOS to zoom
... := TUIWebView.Create; FWebView.setScalesPageToFit(true); // Add this line of code FDelegate := TiOSWebViewDelegate.Create; FDelegate.SetWebBrowser(Self); ...

Embarcadero AppMethod: another route to cross-platform mobile, now with C++ support
Embarcadero has updated AppMethod, its IDE for cross-platform mobile and desktop applications. The IDE now supports C++, and as a special offer, ...

Resources last updated: 12/25/2015 7:43:25 PM