2013-03-26 30 views
0

我遵循; http://dotnettim.wordpress.com/2011/04/17/lightswitchdisplaying-web-pages-html-on-a-screen/使用System.Windows.Controls.WebBrowser(LightSwitch,VS2012)显示网页

但是,而不是一个网页im留下; enter image description here

即时通讯使用VS2012,这个例子是在VS2010。我遇到的代码差异如下:

Original;

private void WebPage_Activated() 

矿;

partial void WebPage_Activated() 

我检查了调试器和事件触发顺利,有没有beteween版本作出任何重大变化或者是有别的,我都忽略了。

我将所有的代码都包含在我放置自定义控件的位置(我对此部分不太确定);

public partial class WebPage 
    { 
     partial void WebPage_Activated() 
     { 
      // Write your code here. 
      this.FindControl("prpWebPage").ControlAvailable += webControlAvailable; 
     } 

     private void webControlAvailable(object sender, ControlAvailableEventArgs e) 
     { 
      ((System.Windows.Controls.WebBrowser)e.Control).Navigate(new Uri("http://news.bbc.co.uk")); 
     } 

    } 

enter image description here

回答

2

我解决了它的大小设置为0 initally。所以;

enter image description here

固定它:)