次の方法で共有


InputModeEditor クラス

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

テキストを入力するための Smartphone 入力メソッドにアクセスできるようにします。

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

構文

'宣言
Public NotInheritable Class InputModeEditor
'使用
Dim instance As InputModeEditor
public sealed class InputModeEditor
public ref class InputModeEditor sealed
[<SealedAttribute>]
type InputModeEditor =  class end

解説

入力モードは、TextBox でのみ設定できます。入力モードを指定するには、InputMode 列挙体の値のいずれかを指定します。Smartphone は、ABC、T9、および数字の各入力モードをサポートしています。

AlphaCurrent モードは、英字用に使用するテキスト ボックスの優先入力モード値です。このモードは、Smartphone でアスタリスク (*) キーを押しながら選択したモードに一致します。InputModeEditor を使用して、英字入力モードの大文字と小文字の設定を明示的に変更することはできません。ただし、使用する英字入力モード (T9 または ABC) は、アスタリスク キーを使用して設定した場合の AlphaCurrent 入力モードで保持されます。

Smartphone 2003 でサポートされています。Smartphone 以外のデバイスまたは TextBox 以外のコントロールでこのクラスを使用すると失敗しますが、例外はスローされません。

次の 3 つのテキスト ボックスに入力モードを設定する次のコード例に示します。Name、Phone、および City。Name テキスト ボックスおよび City テキスト ボックスは、AlphaCurrent 入力モードで設定され、Phone テキスト ボックスは、Numeric 入力モードで設定されています。

AlphaCurrent の動作を確認するには、次の手順を実行します。

  1. 選択した Name テキスト ボックスで、T9 または ABC 入力モードを使用して、アスタリスク キーを押しながらテキストを入力します。

  2. City テキスト ボックスにテキストを入力します。入力モードは、Name テキスト ボックスと同じです。

Imports System
Imports System.Windows.Forms
Imports Microsoft.WindowsCE.Forms



PublicClass Form1
   Inherits System.Windows.Forms.Form
   Private mainMenu1 As System.Windows.Forms.MainMenu
   Private mi1 As System.Windows.Forms.MenuItem

   ' Text box for name.Private textBox1 As System.Windows.Forms.TextBox
   ' Text box for phone number.Private textBox2 As System.Windows.Forms.TextBox
   ' Text box for city.Private textBox3 As System.Windows.Forms.TextBox

   ' Labels for name, phone, and cityPrivate label1 As System.Windows.Forms.Label
   Private label2 As System.Windows.Forms.Label
   Private label3 As System.Windows.Forms.Label


   PublicSubNew()

      InitializeComponent()

      ' Add a menu to close the application.
      mi1 = New MenuItem()
      mainMenu1.MenuItems.Add(mi1)
      AddHandler mi1.Click, AddressOf mi1_Click
      mi1.Text = "Done"
      ' Set input mode for name text box to AlphaCurrent.
      InputModeEditor.SetInputMode(textBox1, InputMode.AlphaCurrent)

      ' Set input mode for phone number text box to Numeric.
      InputModeEditor.SetInputMode(textBox2, InputMode.Numeric)
      ' Set input mode for city text box to AlphaCurrent.
      InputModeEditor.SetInputMode(textBox3, InputMode.AlphaCurrent)
   EndSubProtectedOverridesSub Dispose(disposing AsBoolean)
      MyBase.Dispose(disposing)
   EndSubPrivateSub InitializeComponent()
      Me.mainMenu1 = New System.Windows.Forms.MainMenu()

      Me.mainMenu1 = New System.Windows.Forms.MainMenu()
      Me.textBox1 = New System.Windows.Forms.TextBox()
      Me.textBox2 = New System.Windows.Forms.TextBox()
      Me.textBox3 = New System.Windows.Forms.TextBox()

      Me.label1 = New System.Windows.Forms.Label()
      Me.label2 = New System.Windows.Forms.Label()
      Me.label3 = New System.Windows.Forms.Label()
      '      ' textBox1      'Me.textBox1.Location = New System.Drawing.Point(64, 8)
      Me.textBox1.Size = New System.Drawing.Size(104, 25)
      Me.textBox1.Text = ""      '      ' textBox2      'Me.textBox2.Location = New System.Drawing.Point(64, 40)
      Me.textBox2.Size = New System.Drawing.Size(104, 25)
      Me.textBox2.Text = ""      '      ' textBox3      'Me.textBox3.Location = New System.Drawing.Point(64, 72)
      Me.textBox3.Size = New System.Drawing.Size(104, 25)
      Me.textBox3.Text = ""      '      ' label1      'Me.label1.Location = New System.Drawing.Point(8, 8)
      Me.label1.Size = New System.Drawing.Size(56, 22)
      Me.label1.Text = "Name"      '      ' label2      'Me.label2.Location = New System.Drawing.Point(8, 40)
      Me.label2.Size = New System.Drawing.Size(56, 22)
      Me.label2.Text = "Phone"      '      ' label3      'Me.label3.Location = New System.Drawing.Point(8, 72)
      Me.label3.Size = New System.Drawing.Size(56, 22)
      Me.label3.Text = "City"      '      ' Form1      'Me.Controls.Add(textBox1)
      Me.Controls.Add(textBox2)
      Me.Controls.Add(textBox3)
      Me.Controls.Add(label1)
      Me.Controls.Add(label2)
      Me.Controls.Add(label3)
      Me.Menu = Me.mainMenu1
      Me.Text = "Input Mode Demo"EndSubSharedSub Main()
      Application.Run(New Form1())
   EndSubPrivateSub mi1_Click(sender AsObject, e As EventArgs)
      Me.Close()
   EndSubEndClass
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms;

publicclass Form1 : System.Windows.Forms.Form
{
 private System.Windows.Forms.MainMenu mainMenu1;
 private System.Windows.Forms.MenuItem mi1;

 // Text box for name.private System.Windows.Forms.TextBox textBox1;
 // Text box for phone number.private System.Windows.Forms.TextBox textBox2;
 // Text box for city.private System.Windows.Forms.TextBox textBox3;

 // Labels for name, phone, and cityprivate System.Windows.Forms.Label label1;
 private System.Windows.Forms.Label label2;
 private System.Windows.Forms.Label label3;

 public Form1()
 {

  InitializeComponent();

  // Add a menu to close the application.
  mi1 = new MenuItem();
  mainMenu1.MenuItems.Add(mi1);
  mi1.Click +=new EventHandler(mi1_Click);
  mi1.Text = "Done";

  // Set input mode for name text box to AlphaCurrent.
  InputModeEditor.SetInputMode(textBox1, InputMode.AlphaCurrent);

  // Set input mode for phone number text box to Numeric.
  InputModeEditor.SetInputMode(textBox2, InputMode.Numeric);

  // Set input mode for city text box to AlphaCurrent.
  InputModeEditor.SetInputMode(textBox3, InputMode.AlphaCurrent);


 }

 protectedoverridevoid Dispose( bool disposing )
 {
  base.Dispose( disposing );
 }

 privatevoid InitializeComponent()
 {
  this.mainMenu1 = new System.Windows.Forms.MainMenu();

  this.mainMenu1 = new System.Windows.Forms.MainMenu();
  this.textBox1 = new System.Windows.Forms.TextBox();
  this.textBox2 = new System.Windows.Forms.TextBox();
  this.textBox3 = new System.Windows.Forms.TextBox();

  this.label1 = new System.Windows.Forms.Label();
  this.label2 = new System.Windows.Forms.Label();
  this.label3 = new System.Windows.Forms.Label();
  //// textBox1//this.textBox1.Location = new System.Drawing.Point(64, 8);
  this.textBox1.Size = new System.Drawing.Size(104, 25);
  this.textBox1.Text = "";
  //// textBox2//this.textBox2.Location = new System.Drawing.Point(64, 40);
  this.textBox2.Size = new System.Drawing.Size(104, 25);
  this.textBox2.Text = "";
  //// textBox3//this.textBox3.Location = new System.Drawing.Point(64, 72);
  this.textBox3.Size = new System.Drawing.Size(104, 25);
  this.textBox3.Text = "";
  //// label1//this.label1.Location = new System.Drawing.Point(8, 8);
  this.label1.Size = new System.Drawing.Size(56, 22);
  this.label1.Text = "Name";
  //// label2//this.label2.Location = new System.Drawing.Point(8, 40);
  this.label2.Size = new System.Drawing.Size(56, 22);
  this.label2.Text = "Phone";
  //// label3//this.label3.Location = new System.Drawing.Point(8, 72);
  this.label3.Size = new System.Drawing.Size(56, 22);
  this.label3.Text = "City";
  //// Form1//this.Controls.Add(this.textBox1);
  this.Controls.Add(this.textBox2);
  this.Controls.Add(this.textBox3);
  this.Controls.Add(this.label1);
  this.Controls.Add(this.label2);
  this.Controls.Add(this.label3);
  this.Menu = this.mainMenu1;
  this.Text = "Input Mode Demo";

 }

 staticvoid Main()
 {
  Application.Run(new Form1());
 }

 privatevoid mi1_Click(object sender, EventArgs e)
 {
  this.Close();
 }
}

継承階層

System.Object
  Microsoft.WindowsCE.Forms.InputModeEditor

スレッド セーフ

この型のすべてのパブリック static (Visual Basic では Shared) メンバーは、スレッド セーフです。 インスタンス メンバーの場合は、スレッド セーフであるとは限りません。

プラットフォーム

Windows Mobile for Smartphone

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

バージョン情報

.NET Compact Framework

サポート対象 : 3.5、2.0

参照

参照

InputModeEditor メンバー

Microsoft.WindowsCE.Forms 名前空間

その他の技術情報

方法 : Smartphone の入力モードの設定