如何在Windows Phone中添加Web浏览器弹出窗口(代码隐藏)

时间:2013-10-07 09:12:18

标签: .net wpf windows-phone-7

以下是我用于将网络浏览器添加到弹出控件中的代码段,但似乎无效。

       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;

1 个答案:

答案 0 :(得分:1)

您必须设置web浏览器控件的高度和宽度。