Page 1 of 1

Using component while Form invisible

Posted: Wed Jun 22, 2022 8:01 am
by pX0r
Hi,

first of all i like to thank you for the hard work to build this component.

I've used for a POC the VCL.Edge component first and tried to get managing the ClientCertficate Dialog but with the version of the component it was impossible for me to get it working.

My usecase is that the component is used 2 times on a form, one is invisible and gets a json as result and the second component is visible on the form for user actions on a different url.

Currently your component will not init correctly if i set the mainform to invisible from the very beginning of the application start.
Is there a way around this ? In the VCL.Edge component i did not have that issue.


Best regards

Re: Using component while Form invisible

Posted: Wed Jun 22, 2022 7:06 pm
by salvadordf
Hi,

I thought this was a known WebView2 issue but after reading the following link perhaps there's a workaround.
https://github.com/MicrosoftEdge/WebView2Feedback/issues/1077

I'll take a look as soon as I can.

Re: Using component while Form invisible

Posted: Thu Jun 23, 2022 2:18 pm
by pX0r
Hi,

i've managed it to get it working with filling the property "DefaultURL" and not using WVBrowser1.Navigate anymore on both WVBrowser components.
Unfortunally now i have a different problem that a wvbrowser1.refresh not refreshing on both components.

Re: Using component while Form invisible

Posted: Fri May 31, 2024 7:53 am
by vitaliy_zh
Hi,

the problem is still exists. When TWVWindowParent is created in a parent object that is invisible at the start of the application, a white rectangle remains in place of the browser as soon as the parent object becomes visible.

Is there any solution for this?

Thanks!

Re: Using component while Form invisible

Posted: Fri May 31, 2024 8:52 am
by salvadordf
Hi,

Try this :
  • Create the TWVBrowser and TWVWindowParent instances.
  • Call TWVBrowser.CreateBrowser.
  • Set the parent object visible
  • Call TWVBrowser.IsVisible to True
  • Call TWVWindowParent.UpdateSize
If that fails, call TWVBrowser.CreateBrowser after setting the parent object visible.

PS: If you use VistualBox you may see that the browser takes several seconds until it shows the contents. This doesn't happen on a real computer.

Re: Using component while Form invisible

Posted: Fri May 31, 2024 6:54 pm
by vitaliy_zh
Yes, it works! Thank You @salvadordf !!!