[英]How to handle OrientationChanged event with vb.net for Windows 8.1 store application
我安装了Windows 8.1和Visual Studio 2013 RC。
我已经创建了一个新的针对.NET Framework 4.5.1的Windows应用商店项目。
然后,我在工具箱的MainPage.xaml上放置了一个文本框。
从属性,我将其名称更改为“ TextBox1”
我已经阅读了这篇文章 ,并导入了这些类:
Windows.Graphics.Display
Windows.Graphics.Display.DisplayInformation
然后在MainPage类中放置小数位数:
Private Event OrientationChanged As TypedEventHandler(Of DisplayInformation, Object)
以及私有方法的声明:
Private Sub ChangeText() Handles Me.OrientationChanged
TextBox1.Text = "Hello World"
End Sub
我检查了“模拟器”选项卡并运行了项目。
然后使用模拟器,我按下“顺时针旋转”按钮,但是TextBox1的文本没有改变。
上面的代码有什么问题? 我是否错过了处理事件的全部要点,或者其他事情不对?
提前致谢。
OrientationChanged不会在模拟器中触发。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.