-
Notifications
You must be signed in to change notification settings - Fork 51
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
With WebView2 inside a C# DialogForm : after call to Hide(), WebView2 stay visible #828
Comments
I have the same problem (VB.NET), the bug seems random. |
Thank you for reporting this issue. Having our WebView2 inside a ShowDialog does seem as something we didn't quite cover with our testing. We will work on it and get back to you. |
@Phildre92 What's the namespace of the DialogForm you mentioned? Is that Microsoft.Web.Management.Client.Win32.DialogForm? I'm trying to repo the bug. But I haven't found this control. |
I'm using "Microsoft.Web.WebView2.WinForms.WebView2 " in a "System.Windows.Forms". "visible" field of "WebView2" seems to be compliant with visible forms status. But after closing the forms "WebView2.visible = false" but "WebView2" is always shown. "WebView2" is shown on the first call to "ShowDialog()", but then not hidden when closing the form clicking on the window manager cross in the upper right corner of the window. To open "WebView2" included in this modal form, i need to add callback "System.EventHandler(this.Item_Form_Shown)" to the form. These callback call "show()" on "WebView2". To close "WebView2" included in this modal form, i need to add callback "System.Windows.Forms.FormClosedEventHandler(this.Item_Form_FormClosed)" to the form. These callback call "Hide()" on "WebView2". |
Same Issue w/ ME using (var myWebView2 = new myWebView2())
{
carfaxForm.ShowDialog();
} Helped my case. |
It's also when the Form is displayed as MDI Child in a tabbed MDI Controller. When there is no other Window inside the tabbed MDI Container the WebView is hidden when form.hide() is called, but if there is another form in the tabbed mdi container, the webview stays on top as a seperate formless window. It reattaches itself if the containig form is shown again. Setting form.mdiparent = nothing before hiding the form and reattaching it to the mdiparent when shown solved the issue, but that is only a workarround. |
This should be fixed in 1.0.902-prerelease SDK. Thanks! |
Description
I have a WebView2 inside a C# DialogForm.
The Hide() Function close the DialogForm but WebView2 window stays visible as a top level window.
There a similar problem with Show() for a DialogForm, WebView2 stays invisible.
To "solve" this problem, I have managed myself visibility of WebView2 window :
There is also a similar problem when the WebView2 is in TabPanel.
Version
Microsoft Visual Studio Community 2019
Version 16.8.2
VisualStudio.16.Release/16.8.2+30717.126
Microsoft .NET Framework
Version 4.8.04084
Visual C++ 2019 00435-60000-00000-AA288
Microsoft Visual C++ 2019
Package Microsoft Visual Studio VC 1.0
Package Microsoft Visual Studio VC
SDK: Microsoft.Web.WebView2 1.0.674-prerelease
Runtime: Canary Version 89.0.767.0 (Version officielle) (64 bits)
Framework: WinForms
OS: Win10
AB#31680887
The text was updated successfully, but these errors were encountered: