Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Using component while Form invisible

Post Reply
pX0r
Posts: 2
Joined: Tue Jun 21, 2022 10:06 pm

Using component while Form invisible

Post 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
User avatar
salvadordf
Posts: 4125
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Using component while Form invisible

Post 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.
pX0r
Posts: 2
Joined: Tue Jun 21, 2022 10:06 pm

Re: Using component while Form invisible

Post 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.
vitaliy_zh
Posts: 9
Joined: Thu Apr 02, 2020 2:28 pm

Re: Using component while Form invisible

Post 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!
User avatar
salvadordf
Posts: 4125
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Using component while Form invisible

Post 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.
Post Reply