ScreenOrientation 列挙体

[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。]

ScreenOrientation プロパティによってアクセスできるデバイス画面の向きの角度を指定します。

名前空間:  Microsoft.WindowsCE.Forms
アセンブリ:  Microsoft.WindowsCE.Forms (Microsoft.WindowsCE.Forms.dll 内)

構文

'宣言
Public Enumeration ScreenOrientation
'使用
Dim instance As ScreenOrientation
public enum ScreenOrientation
public enum class ScreenOrientation
type ScreenOrientation

メンバー

メンバー名 説明
.NET Compact Framework によるサポート Angle0 縦向き (角度 0 度) を指定します。
.NET Compact Framework によるサポート Angle90 向きを 90 度に指定します。
.NET Compact Framework によるサポート Angle180 横向き (角度 180 度) を指定します。
.NET Compact Framework によるサポート Angle270 向きを 270 度に指定します。

解説

角度は 0、既定の縦向きです。Pocket PC 2003 更新プログラムが必要です。

ScreenOrientation 列挙体を使用して、ボタンをクリックしたときに画面の向きを回転させる方法を次のコード例に示します。このコード例は、SystemSettings クラスのトピックで取り上げているコード例の一部分です。

' Each click event changes the screen orientation, as determined' by the variable x, which increments from 0 to 3 and then back' to 0. Four clicks cycle through the ScreenOrientation enumeration.PrivateSub Button1_Click(sender AsObject, e As System.EventArgs) Handles Button1.Click

   SelectCase x
      Case 0

         ' Pass a value for the ScreenOrientation enumeration         ' to the SetOrientation method, defined below,         ' and increment x so that the next button         ' click rotates the screen orientation.
         SetOrientation(ScreenOrientation.Angle90)
         x += 1
      Case 1
         SetOrientation(ScreenOrientation.Angle180)
         x += 1
      Case 2
         SetOrientation(ScreenOrientation.Angle270)
         x += 1
      Case 3
         SetOrientation(ScreenOrientation.Angle0)
         x = 0
      CaseElse
         SetOrientation(ScreenOrientation.Angle0)
         x = 0
   EndSelectEndSub

' Set the orientation to a value of the' ScreenOrienation enumeration and update the' status bar with the current angle.PrivateSub SetOrientation(so As ScreenOrientation)
   ' Set the requested orientation.
   SystemSettings.ScreenOrientation = so

   Me.StatusBar1.Text = SystemSettings.ScreenOrientation.ToString()
EndSub
// Each click event changes the screen orientation, as determined// by the variable x, which increments from 0 to 3 and then back// to 0. Four clicks cycle through the ScreenOrientation enumeration.privatevoid button1_Click(object sender, System.EventArgs e)
{

 switch(x)
 {
  case 0:

   // Pass a value for the ScreenOrientation enumeration// to the SetOrientation method, defined below,// and increment x so that the next button// click rotates the screen orientation.
   SetOrientation(ScreenOrientation.Angle90);
   x++;
   break;
  case 1:
   SetOrientation(ScreenOrientation.Angle180);
   x++;
   break;
  case 2:
   SetOrientation(ScreenOrientation.Angle270);
   x++;
   break;
  case 3:
   SetOrientation(ScreenOrientation.Angle0);
   x = 0;
   break;
  default:
   SetOrientation(ScreenOrientation.Angle0);
   x = 0;
   break;
 }
}

 // Set the orientation to a value of the// ScreenOrienation enumeration and update the// status bar with the current angle.privatevoid SetOrientation(ScreenOrientation so)
{
 // Set the requested orientation.

 SystemSettings.ScreenOrientation = so;

 this.statusBar1.Text = SystemSettings.ScreenOrientation.ToString();
}

プラットフォーム

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

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。 サポートされているバージョンについては、「.NET フレームワークのシステム要件」を参照してください。

バージョン情報

.NET Compact Framework

サポート対象 : 3.5、2.0

参照

参照

Microsoft.WindowsCE.Forms 名前空間