Skip to content
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

WebView2 have a border #135

Open
X-Yunner opened this issue Jul 24, 2024 · 13 comments
Open

WebView2 have a border #135

X-Yunner opened this issue Jul 24, 2024 · 13 comments

Comments

@X-Yunner
Copy link

X-Yunner commented Jul 24, 2024

I have two Windows: loginwindow and mainwindow. webview2 In the mainwindow, I first display the loginwindow and it will have a border.
Snipaste_2024-07-24_14-07-37

After the loginwindow disappears, there will still be a border in the mainwindow. How can I cancel this border?
Snipaste_2024-07-24_14-16-01

Snipaste_2024-07-24_14-11-56

code
image

@ChrisPulman
Copy link
Member

Thank you for raising this, I will investigate what might be the cause of the border and provide and update if there is a way to resolve this issue.

@ChrisPulman
Copy link
Member

ChrisPulman commented Jul 25, 2024

@X-Yunner Please could you try V2.0.2 and see if the issue still exists, if it doesn't fix the issue, would it be possible to put a minimal demonstration of the issue to assist me to see where the issue is coming from.

@X-Yunner
Copy link
Author

X-Yunner commented Jul 25, 2024

Thank you for handling the problem so quickly. I created a demo library in my github repository, which can reproduce this problem.
https://github.com/X-Yunner/TestWebView2
I checked for distribution problems myself. It seems that the wpf-ui library appears. If I use this ui library, a border will appear in webview2. Maybe I will go to the wpf-ui library and ask questions. Anyway, thanks.

@ChrisPulman
Copy link
Member

Thank you for handling the problem so quickly. I created a demo library in my github repository, which can reproduce this problem. X-Yunner/TestWebView2 I checked for distribution problems myself. It seems that the wpf-ui library appears. If I use this ui library, a border will appear in webview2. Maybe I will go to the wpf-ui library and ask questions. Anyway, thanks.

@X-Yunner I created a PR in your repository, hopefully we can find what is happening in your app.

@X-Yunner
Copy link
Author

Yes, I have seen Pr, it seems that the different versions of the computer system caused by the border problem

@ChrisPulman
Copy link
Member

ChrisPulman commented Jul 25, 2024

Which OS are you using?
I'm using Windows 11, but I could test on any OS if required.
I saw the target OS is Windows 10.
I will try to test this in the next couple of days.

@X-Yunner
Copy link
Author

X-Yunner commented Jul 26, 2024

Looking forward to a solution.
This is my system information.

version: Windows 10 Home Chinese Edition
version number: 22H2
installation date: ‎2024/‎1/‎15
Operating system build version: 19045.4651
experience: Windows Feature Experience Pack 1000.19060.1000.0

ChrisPulman added a commit that referenced this issue Jul 28, 2024
Update controls
@ChrisPulman
Copy link
Member

@X-Yunner please update to V2.0.3 of CrissCross, I believe I found the issue you were experiencing with Windows 10, I have made the functionality equal for Windows 10 or 11.

You may wish to consider using a MVVM approach and have a single Wpf Window per physical monitor as a Navigation Host window for displaying a multitude of UserControls (Views) controlled with navigation.

@X-Yunner
Copy link
Author

Yes, thank you for fixing it. There is no border in the loginwindow interface, but there is still a border in the mainwindow. Is there a way to cancel it?
Snipaste_2024-07-29_09-27-50

@ChrisPulman
Copy link
Member

@X-Yunner I will try to see where that comes from, it looks like a scroll viewer which I do not add, but if I can locate the source and control it, I will let you know how I get on.

@ChrisPulman
Copy link
Member

@X-Yunner I believe that the base WebView2 component has been updated to include this scroll component and is there as a part of the Microsoft control which has no exposure to the external API to control it. The border you are seeing is part of the scroll viewer, the UX appears differently between Windows 10 and Windows 11 as you have experienced. Hopefully your client can update to Windows 11 and solve the issue for us :)
I have raised the issue within the Microsoft Webview2 control, but unfortunately nothing happens quickly there.

@X-Yunner
Copy link
Author

X-Yunner commented Aug 1, 2024

Is this the problem you are talking about? If I don't include a control in it, it will have a True appear.

image

@ChrisPulman
Copy link
Member

@X-Yunner I will see if I can find the true, that is definitely a strange one. I will focus on this tonight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants