如果要让一个SL控件布满它的父亲容器,那么要去除它的所有位置设定属性(如:左对齐等也算)

如果要让一个SL全屏(看不到IE的框框)那么用:

System.Windows.InteropBrowserHost.IsFullScreen = true;

恢复:System.Windows.InteropBrowserHost.IsFullScreen = false;

另外一种方式:

Content contentObject = Application.Current.Host.Content;

contentObject.IsFullScreen = true;

因为在全屏的时候会出现一个提示:要复写掉它可以这样的

EventHandler(Content_FullScreenChanged);

 

实现事件处理

sender, EventArgs e) { Content contentObject = Application.Current.Host.Content; if (contentObject.IsFullScreen) { toggleButton.Background = new SolidColorBrush(Colors.Green); toggleButton.Content = "Full Screen Mode"; } else { toggleButton.Background = new SolidColorBrush(Colors.Red); toggleButton.Content = "Normal Mode"; } }

相关文章:

  • 2021-12-09
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
猜你喜欢
  • 2022-02-05
  • 2022-12-23
  • 2022-03-09
  • 2021-11-20
  • 2021-05-24
  • 2021-10-01
  • 2022-12-23
相关资源
相似解决方案