0

下面是我用来将网络浏览器添加到弹出控件但似乎不起作用的代码片段。

       Popup codePopup = new Popup();
        StackPanel test = new StackPanel();
        WebBrowser wb1 = new WebBrowser();
        wb1.Navigated += wb1_Navigated;
        wb1.Navigate(new Uri(@"http://www.google.com"));
        test.Children.Add(wb1);
        test.Height = Application.Current.Host.Content.ActualHeight;
        test.Width = Application.Current.Host.Content.ActualWidth;
        codePopup.Child = test;
        this.LayoutRoot.Children.Add(codePopup);
        codePopup.IsOpen = true;
4

1 回答 1

1

您必须设置 webbrowser 控件的高度和宽度。

于 2013-10-07T10:13:34.833 回答