如果我将应用程序切换到全屏,则不会处理键盘的所有输入.没有文本框输入,没有按键/按键事件,可能还有更多.这是一个演示此的示例应用程序:
Xaml:
<Canvas><TextBlock Text="Try some input:" Canvas.top="10" WIDth="100"></TextBlock><TextBox x:name="tBoxinput" WIDth="100" Canvas.top="30"></TextBox><button x:name="btnFullScreen" Content="Go Full Screen" Canvas.top="60"></button></Canvas>
代码背后:
public Page() {InitializeComponent();btnFullScreen.Click += new RoutedEventHandler(btnFullScreen_Click); }voID btnFullScreen_Click(object sender,RoutedEventArgs e) {Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen; if (!Application.Current.Host.Content.IsFullScreen)btnFullScreen.Content = "Go Full Screen"; elsebtnFullScreen.Content = "Go normal Screen"; }
很容易看到,在全屏模式下,您无法在文本框中写入文本.我在这里做错了吗?有没有其他方法可以切换全屏,所以这不会发生?
解决方法 此链接可以帮助您: http://silverlight.net/forums/p/11519/36798.aspx编辑
这个MSDN article给出了一个更详细的原因:
总结When a Silverlight plug-in is in full-screen mode,it disables most keyboard events. This limitation of keyboard input during full-screen mode is a security feature,and is intended to minimize the possibility of unintended information being entered by a user. In full-screen mode,the only input allowed is through the following keys.
UP ARROW,DOWN ARROW,left ARROW,RIGHT ARROW,SPACEbar,TAB,PAGE UP,PAGE DOWN,HOME,END,ENTER
以上是内存溢出为你收集整理的silverlight – 为什么我在全屏模式下无法获得键盘输入事件?全部内容,希望文章能够帮你解决silverlight – 为什么我在全屏模式下无法获得键盘输入事件?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)