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 ?
TWebView setparent TPanel
Re: TWebView setparent TPanel
Hi,
Please check this variable TPanel:New() in tpanel.prg
::nExStyle = WS_EX_CONTROLPARENT
and use oPanel:Show() after DEFINE PANEL oPanel
Please check this variable TPanel:New() in tpanel.prg
::nExStyle = WS_EX_CONTROLPARENT
and use oPanel:Show() after DEFINE PANEL oPanel
Best regards,
Ertan,
Re: TWebView setparent TPanel
Actually, in the TPanel:New() method, this value is specified by default
::nExStyle = WS_EX_CONTROLPARENT
? oPanel:nExStyle returns 65536
So what ?
::nExStyle = WS_EX_CONTROLPARENT
? oPanel:nExStyle returns 65536
So what ?
Re: TWebView setparent TPanel
Can you try to set oWebView:SetParent(oPanel) command in on init of panel.Natter wrote: 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 ?
Regards,
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.06
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.06
- Antonio Linares
- Site Admin
- Posts: 44515
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: TWebView setparent TPanel
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 ...
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 ...
Re: TWebView setparent TPanel
I'm using FW 23.7, there's only the TWebView() class()
Of course, I create all the controls in the ini function
ACTIVATE DIALOG i ON INIT My_Ini()
function My_Ini
oPn:=TPanel():New()
oWebView:=TWybWiew():New()
oWebView:SetParent(oPn)
? len(oPn:aControls) -> 0
return
Of course, I create all the controls in the ini function
ACTIVATE DIALOG i ON INIT My_Ini()
function My_Ini
oPn:=TPanel():New()
oWebView:=TWybWiew():New()
oWebView:SetParent(oPn)
? len(oPn:aControls) -> 0
return
- Antonio Linares
- Site Admin
- Posts: 44515
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: TWebView setparent TPanel
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
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