Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF WebBrowser不显示页面_C#_Wpf - Fatal编程技术网

C# WPF WebBrowser不显示页面

C# WPF WebBrowser不显示页面,c#,wpf,C#,Wpf,我已经用WebBrowser创建了一个WPFUserControl。它在运行后加载页面,但不显示加载的页面 <UserControl x:Class="PsyboInventory.Tiles.About.AboutTile" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/win

我已经用
WebBrowser
创建了一个WPF
UserControl
。它在运行后加载页面,但不显示加载的页面

<UserControl x:Class="PsyboInventory.Tiles.About.AboutTile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="800">
    <Grid>
        <WebBrowser x:Name="browser" Height="253" Margin="300,96,36,0"  VerticalAlignment="Top"/>
    </Grid>
</UserControl>

这真的是
UserControl
的XAML中所有的代码吗?
lblCopy
在哪里定义?您还可以用您使用的
AboutTile
部分更新您的帖子吗?我问这个问题是因为我尝试了这个例子(没有
lblCopy
),它对我来说很好(除了页面上的两个脚本错误)。它不是一个错误。我的usercontroll中包含了一个标签。如果你没有加载
处理程序和
边距
/
高度
,它运行时没有语法错误,你看到什么了吗<代码>
Iam已尝试,但页面已加载但不可见空的
catch
块是否有特定原因?
public AboutTile()
{
    InitializeComponent();

    try
    {
        browser.Loaded += delegate
        {
            browser.Navigate("http://www.google.fi/");
        };
    }
    catch { }
}