SystemSettings.ScreenOrientation 属性

获取或设置设备的当前屏幕方向。

命名空间:  Microsoft.WindowsCE.Forms
程序集:  Microsoft.WindowsCE.Forms(在 Microsoft.WindowsCE.Forms.dll 中)

语法

声明
Public Shared Property ScreenOrientation As ScreenOrientation
用法
Dim value As ScreenOrientation

value = SystemSettings.ScreenOrientation

SystemSettings.ScreenOrientation = value
public static ScreenOrientation ScreenOrientation { get; set; }
public:
static property ScreenOrientation ScreenOrientation {
    ScreenOrientation get ();
    void set (ScreenOrientation value);
}
public static function get ScreenOrientation () : ScreenOrientation
public static function set ScreenOrientation (value : ScreenOrientation)

属性值

类型:Microsoft.WindowsCE.Forms.ScreenOrientation

枚举值之一,这些值为 0、90、180 和 270。默认为 0(纵向视图)。

备注

您可以将纵向值 (0) 更改为 90、180 或 270,而无需重置设备。

示例

下面的示例将此属性的值设置为 0 并在状态栏上显示该值。此示例摘自为 SystemSettings 类提供的一个更大的示例。

' Set the screen orientation to normal
' and display the value on the status bar.
SystemSettings.ScreenOrientation = ScreenOrientation.Angle0
Me.StatusBar1.Text = SystemSettings.ScreenOrientation.ToString()
// Set the screen orientation to normal
// and display the value on the status bar.
SystemSettings.ScreenOrientation = ScreenOrientation.Angle0;
this.statusBar1.Text = SystemSettings.ScreenOrientation.ToString();

权限

平台

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Compact Framework

受以下版本支持:3.5、2.0

另请参见

参考

SystemSettings 类

SystemSettings 成员

Microsoft.WindowsCE.Forms 命名空间