PDF 的网络浏览器几秒钟后变灰

发布于 2025-01-17 19:09:16 字数 694 浏览 1 评论 0原文

我的应用程序中有一个网络浏览器,并且运行良好。 现在突然间,几秒钟后它就变成灰色了。

输入图像这里的描述

代码非常简单:

try
{
    var wbb = new WebBrowser() { };
    wbb.Loaded += (s, e) =>
    {
        wbb.Navigate(new Uri(@"C:\temp\a.pdf"));
    };      
    grdMain.Children.Add(wbb);
}
catch (Exception)
{
    throw;
}

我必须放置 try catch 只是为了查看是否引发了任何异常。 这种情况不会发生

wbb.Navigate(new Uri(@"https://www.google.com/"));

我尝试了几种提示(固定大小,IsEnabled=true,...),但没有任何效果, 。 我还搜索了一个破坏视图的事件触发,但找不到它。 我不会选择 WebView2,因为它需要一些无法呈现给客户的可分发内容。 谢谢你的帮助

帕特里克

I had a WebBrowser in my app and it was working well.
Now all of a sudden the behaviour is that after some seconds it goes gray.

enter image description here

The code is extremely simple:

try
{
    var wbb = new WebBrowser() { };
    wbb.Loaded += (s, e) =>
    {
        wbb.Navigate(new Uri(@"C:\temp\a.pdf"));
    };      
    grdMain.Children.Add(wbb);
}
catch (Exception)
{
    throw;
}

I had to put the try catch just to see if any exception was fired.
This doesn't happen with

wbb.Navigate(new Uri(@"https://www.google.com/"));

I tried several hints (fixed size, IsEnabled=true,... ) but none worked.
I also search for an event firing that was spoiling the view but couldn't find it.
I would not go for WebView2 for it needs some distributable which could not be present at the customer.
Thank you for any help

Patrick

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独木成林 2025-01-24 19:09:16

结果发现问题与我的 Internet Explorer 有关。在另一台计算机上尝试相同的程序表明问题仅出现在我的计算机上。

也就是说,在启动 Internet Explorer 时,我会看到一条消息,指出该浏览器将从 2022 年 6 月 22 日起停止使用。这是否意味着 Webview 也将不再工作?

It turned out that the problem is related with my Internet Explorer. Trying the same program on another computer showed that the problem is only on my pc.

That being said when launching Internet Explorer I am shown a message which says that this browser will be discontinued from June the 22nd 2022. Does this mean that also the Webview will not work anymore?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文