FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TWebView setparent TPanel
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
TWebView setparent TPanel
Posted: Wed Oct 01, 2025 12:57 PM
Hi,

There is a control (TPanel) I need to use it as a window for a TWebView object. Making an oWebView:SetParent(oPanel). There is no error, but oWebView does not become a control.
len(oPanel:AControls) will return 0
Is this how it should be or am I wrong ?
Posts: 61
Joined: Wed Jul 26, 2023 12:08 PM
Re: TWebView setparent TPanel
Posted: Wed Oct 01, 2025 01:19 PM

Hi,

Please check this variable TPanel:New() in tpanel.prg

::nExStyle = WS_EX_CONTROLPARENT

and use oPanel:Show() after DEFINE PANEL oPanel

Best regards,
Ertan,

ertan_ozturk@yahoo.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TWebView setparent TPanel
Posted: Wed Oct 01, 2025 01:56 PM

Actually, in the TPanel:New() method, this value is specified by default

::nExStyle = WS_EX_CONTROLPARENT

? oPanel:nExStyle returns 65536

So what ?

Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TWebView setparent TPanel
Posted: Wed Oct 01, 2025 04:34 PM
Natter wrote: Hi,

There is a control (TPanel) I need to use it as a window for a TWebView object. Making an oWebView:SetParent(oPanel). There is no error, but oWebView does not become a control.
len(oPanel:AControls) will return 0
Is this how it should be or am I wrong ?
Can you try to set oWebView:SetParent(oPanel) command in on init of panel.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TWebView setparent TPanel
Posted: Wed Oct 01, 2025 04:55 PM

Dear Yuri,

You should do:

oWebView := TWebView2():New( oPanel )

If the panel is on a dialog box, then you have to do it from ACTIVATE DIALOG ... ON INIT ...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TWebView setparent TPanel
Posted: Wed Oct 01, 2025 05:25 PM
I'm using FW 23.7, there's only the TWebView() class()

Of course, I create all the controls in the ini function :D
ACTIVATE DIALOG i ON INIT My_Ini()

function My_Ini
oPn:=TPanel():New()
oWebView:=TWybWiew():New()
oWebView:SetParent(oPn)
? len(oPn:aControls) -> 0
return
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TWebView setparent TPanel
Posted: Wed Oct 01, 2025 05:30 PM
Dear Yuri,

WebView has a special working behavior designed by Microsoft:

When we provide a parent to it, webview creates a child window of the provided window where webview places itself (in the "ghost" child).

Parent --> Ghost child --> webview

This may help you to better understand it :)
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion