-
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
WinForms Invisible / Not showing #437
Comments
@Flaflo - is this problem both in the 0.9.579 pre-release and the 0.9.628 pre-release packages? |
Yes |
Did you update WebView2Loader.dll from the package? |
My hunch is that this is caused by this issue: #431. Can you try the fixes mentioned in that thread and see if that works for you? |
Yes I tried that first, because when I wanted to compile with the newer preview version I got that exact error. The workaround mentioned in there helped me to fix the compile Issue but I still get the same results after that: The form stays invisible. I am clueless right now. |
@Flaflo I've have a few projects that successfully load a WebView2 control using version 0.9.628. Here's a basic demo project: Nothing special, just a WebBrowser2 control on a form with a debugging statement and Source property being set in the "Load" event handler. I recently updated Visual Studio and noticed some weird behavior with the Toolbox for a moment, but that seemed to be resolved by rebooting my computer. |
Okay, after further investigation it seems like the custom form wrapper we built is the issue's origin. Basically what the wrapper does is to get invisible and create a dummy form for a dropshadow and provide a custom invisible pane for drag and drop. Maybe you guys here have a better solution to display a webapp with the help of winforms? |
I'm not sure I understand how the wrapper is interacting with the WebView. Can you share some code? Or describe the ownership/tree structure, as well as what may be layered? |
Well the thing is, the "WrapperForm" is a very hacky thing to let the webapp displayed inside it behave like a native window. Maybe there is a better solution than hacking things together via window messages and native calls. |
If you need a borderless form with shadow, just use a form with
|
Yea thats what ive been up to, but its more than just borderless window with dropshadow. At the end it turned out that the window state when the form is initialized was "minimized" and for some reason the icon also disappeared from the taskbar. That was the whole issue. Thank you all guys this case is closed. I did not mean to steal your time :) |
Glad you got it figured out! Thanks @ukandrewc for the follow-up as well. |
Description
When showing a Windows form with WebView2 as component on it, the form stays invisible and wont show up. It worked last week and without touching the code its now broken. The only thing that was updated is the Edge Chromium version.
Version
SDK: 0.9.579-prerelease / 0.9.628-prerelease
Runtime: Beta 86.0.622.11 / Dev 87.0.634.0
Framework: WinForms
OS: Win10
Repro Steps
Put the WebView component from the toolbox into the form and let the magic happen
It's expected to function as usual and show me the form with the WebView component inside displaying a website.
Screenshots
N / A
Additional context
The WebView is part of a wrapper for a web-app written in Vue. It worked as intended on thursday or friday and since today it stopped working, the only thing that makes sense to me is that Edge's update has broken something WebView was using to render into the form or something like that.
Something interesting: The WebView instance is in fact still running as backgroundprocess behind the main process, so it is clearly started but for some reason stops the form from beeing rendered.
I dont know where else I should put this, thanks in advance for your help.
The text was updated successfully, but these errors were encountered: