-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when change parent of form #13
Comments
Try setting TWVBrowser.ParentWindow to a THandle of another control before reparenting the form. Let's say you hay 2 forms : FormA and FormB. If you want to reparent FormA and it has a browser then you have to follow these steps :
I tested this method with a beta version of BriskBard and it works. |
at the moment i found this solution maybe it can be useful to you
|
I think I understand the steps here. But let me pose another scenario: The architecture of my application consists of a MainForm with a MainPanel, and many various ChildForms, each with a with ChildPanel. The ChildForms are always hidden, but at any point in time, one and only one of the ChildPanels is parented to the MainPanel, e.g. ChildFormA.ChildPanel.Parent := MainForm.MainPanel. As a child panel is switched out, their original parent is restored, e.g. ChildFormA.ChildPanel.Parent := ChildFormA; This gives a "midi" style effect and works great. I also have another form, WVForm, with a WVPanel and on that, there is a WVBrowser and WVWindowParent. Here's what I'm trying to do..
What do I need to do to restore the WVBrowser function whenever ChildFormB.ChildPanel parent changes or if the WVForm is shown. Are there any special considerations that I need to be aware of here? |
@roknjohn It should be possible to do what you describe. Follow the steps I gave previously and call NotifyParentWindowPositionChanged and UpdateSize when necessary as @amancini showed. Alternatively, consider creating TFrames with embedded browsers at runtime as you can see in the TabbedBrowser demo. Edit: I forgot to mention that moving browsers between monitors can be tricky because they can have different scale. I haven't tried this scenario. |
Hello,
if you change the parent of the form that hosts the WVBroser, you go to create an inconsistency in the CoreWebView2Controller interface which is invisible and without parent.
i also tried re-assigning the parentWindow and resetting the visibility but it doesn't work.
I think it's a Microsoft bug, do you know any workarounds?
you can easily reproduce the problem through the tabbedBrowser demo unit that I modified and attached
best regards
TabbedBrowserChange.zip
The text was updated successfully, but these errors were encountered: