Freigeben über


InputPanel.InputMethodCollection-Klasse

Dieser Dokumentation für die Vorschau nur ist und in späteren Versionen geändert. Leere Themen wurden als Platzhalter eingefügt.]

Ermöglicht den Zugriff auf alle Eingabemethode-Software auf einem Pocket PC installiert. Diese Klasse kann nicht geerbt werden.

Namespace:  Microsoft.WindowsCE.Forms
Assembly:  Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)

Syntax

'Declaration
Public NotInheritable Class InputMethodCollection _
    Implements IList, ICollection, IEnumerable
'Usage
Dim instance As InputPanel.InputMethodCollection
public sealed class InputMethodCollection : IList, 
    ICollection, IEnumerable
public ref class InputMethodCollection sealed : IList, 
    ICollection, IEnumerable
[<SealedAttribute>]
type InputMethodCollection =  
    class
        interface IList
        interface ICollection
        interface IEnumerable
    end

Hinweise

Diese Auflistung greift auf die Methoden für Text und Zeichen-Eintrag in die soft input Panel (SIP) auf einem Pocket PC.Allgemeine Eingabemethoden umfassen:

  • Tastatur

    Tippen Sie auf Zeichen auf der SIP-Tastatur oder eine Hardware-Tastatur-Anlage.

  • Buchstabe Recognizer

    Zeichnen Sie Buchstaben und Zahlen an das SIP.Wenn der Benutzer hält, wird das Schreiben automatisch in Druckschrift konvertiert und an der Einfügemarke angezeigt.

  • Erkennung blockieren

    Zeichnen Sie festgelegte Striche auf das SIP, die als bestimmte Zeichen dargestellt.Diese Eingabemethode ähnelt Graffiti-Emulation.

Um Sprachen wie Japanisch und Russisch zu unterstützen, können andere Eingabemethoden installiert werden.Wenn eine neue Eingabemethode auf dem Gerät installiert ist, wird es in der Eingabemethode-Auflistung aufgenommen.

Verwenden Sie die InputMethods -Eigenschaft zum Abrufen einer InputPanel.InputMethodCollection.

Beispiele

Im folgenden Codebeispiel listet InputPanel.InputMethodCollection und listet die verfügbaren Eingabe-Methoden in einem Listenfeld.Wenn ein Benutzer eine Eingabemethode auswählt, wird die CurrentInputMethod-Eigenschaft auf die Eingabemethode festgelegt.Die Enabled -Eigenschaft für den Eingabebereich wird auf true festgelegt, so dass die Tastatur und andere Eingabebereiche für den Benutzer angezeigt werden.

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

PublicClass Form1
   Inherits System.Windows.Forms.Form

   PrivateWithEvents ListBox1 As System.Windows.Forms.ListBox
   Private TextBox1 As System.Windows.Forms.TextBox

   Private InputPanel1 As Microsoft.WindowsCE.Forms.InputPanel


   PublicSubNew()
      InitializeComponent()

      'Display OK Button for closing the application.Me.MinimizeBox = False

      MessageBox.Show(InputPanel1.InputMethods.Count.ToString())

      ' Display the input panel.
      InputPanel1.Enabled = True
      ' Get the input methods to populate the list box.      ' Select the first method.
      GetInputMethods()
      ListBox1.SelectedIndex = 0

      ' Set the focus on the text box to render input from the input panel.
      TextBox1.Focus()
   EndSubProtectedOverridesSub Dispose(disposing AsBoolean)
      MyBase.Dispose(disposing)
   EndSubPrivateSub InitializeComponent()
      Me.InputPanel1 = New Microsoft.WindowsCE.Forms.InputPanel
      Me.ListBox1 = New System.Windows.Forms.ListBox
      Me.TextBox1 = New System.Windows.Forms.TextBox
      '      ' ListBox1      'Me.ListBox1.Location = New System.Drawing.Point(8, 40)
      Me.ListBox1.Size = New System.Drawing.Size(200, 80)
      '      ' TextBox1      'Me.TextBox1.Location = New System.Drawing.Point(8, 140)
      Me.TextBox1.Size = New System.Drawing.Size(200, 200)
      '      ' Form1      'Me.Controls.Add(ListBox1)
      Me.Controls.Add(TextBox1)
      Me.Text = "Input Methods"EndSubSharedSub Main()
      Application.Run(New Form1())
   EndSubPrivateSub GetInputMethods()
      Me.ListBox1.Items.Clear()

      ' Get the InputMethods collection and      ' add each method to the list box.Dim im As InputMethod
      ForEach im In  InputPanel1.InputMethods
         Me.ListBox1.Items.Add(im.Name)
      Next im
  EndSub
   ' This event handler iterates through the   ' InputMethodCollection and sets the input method   ' to the input method selected in the list box.   ' When a member of the collection is the   ' same the selected value in the list box, that   ' method is set to the current input method.PrivateSub ListBox1_SelectedIndexChanged(sender AsObject, e As EventArgs) Handles ListBox1.SelectedIndexChanged

      ' Get the selected input method from the list box.Dim strIM AsString
      strIM = ListBox1.SelectedItem.ToString()

      ' Iterate through the input method collection.      ' When there is a match with the input method      ' selected in the list box, set the      ' CurrentInputMethod property to the selected method.Dim im As InputMethod
      ForEach im In  InputPanel1.InputMethods
         If im.Name = strIM Then            ' Change the input method.
            InputPanel1.CurrentInputMethod = im
         EndIfNext im
   EndSubEndClass
' Note that the InputMethodCollection' can also be enumerated as follows:'  InputPanel.InputMethodCollection imc;'  imc = InputPanel1.InputMethods;'  for (int i = 0; i < imc.Count; i++)'  {'   if (imc[i].Name == strIM)'   {'    // Change input method.'    InputPanel1.CurrentInputMethod = imc[i];''    break;'   }'  }
using System;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms;

namespace InputMethodsTest
{
publicclass Form1 : System.Windows.Forms.Form
{
 private System.Windows.Forms.MainMenu mainMenu1;
 private System.Windows.Forms.ListBox listBox1;
 private System.Windows.Forms.TextBox textBox1;

 private Microsoft.WindowsCE.Forms.InputPanel ip;

 public Form1()
 {
  InitializeComponent();

  //Display OK Button for closing the application.this.MinimizeBox = false;

  MessageBox.Show(ip.InputMethods.Count.ToString());

  // Display the input panel.
  ip.Enabled = true;

  // Get the input methods to populate the list box.// Select the first method.
  GetInputMethods();
  listBox1.SelectedIndex = 0;

  // Set the focus on the text box to render input from the input panel.
  textBox1.Focus();

 }
 protectedoverridevoid Dispose( bool disposing )
 {
  base.Dispose( disposing );
 }
 #region Windows Form Designer generated code

 privatevoid InitializeComponent()
 {
  this.mainMenu1 = new System.Windows.Forms.MainMenu();
  this.ip = new InputPanel();
  this.listBox1 = new ListBox();
  this.textBox1 = new TextBox();
  //// listBox1//this.listBox1.Location = new System.Drawing.Point(8, 40);
  this.listBox1.Size = new System.Drawing.Size(200, 80);
  this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
  //// textBox1//this.textBox1.Location = new System.Drawing.Point(8, 140);
  this.textBox1.Size = new System.Drawing.Size(200, 200);
  //// Form1//this.Controls.Add(this.listBox1);
  this.Controls.Add(this.textBox1);
  this.Menu = this.mainMenu1;
  this.Text = "Input Methods";
 }
 #endregion

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

 privatevoid GetInputMethods()
 {
  this.listBox1.Items.Clear();


 // Get the InputMethods collection and// add each method to the list box.foreach (InputMethod im in ip.InputMethods)
 {
  this.listBox1.Items.Add(im.Name);
 }
 }

 // This event handler iterates through the// InputMethodCollection and sets the input method// to the input method selected in the list box.// When a member of the collection is the// same the selected value in the list box, that// method is set to the current input method.privatevoid listBox1_SelectedIndexChanged(object sender, EventArgs e)
 {

 // Get the selected input method from the list box.string strIM;
 strIM = listBox1.SelectedItem.ToString();

 // Iterate through the input method collection.// When there is a match with the input method// selected in the list box, set the// CurrentInputMethod property to the selected method.foreach (InputMethod im in ip.InputMethods)
 {
  if (im.Name == strIM)
   // Change the input method.
   ip.CurrentInputMethod = im;
 }

 // Note that the InputMethodCollection// can also be enumerated as follows://  InputPanel.InputMethodCollection imc;//  imc = ip.InputMethods;//  for (int i = 0; i < imc.Count; i++)//  {//   if (imc[i].Name == strIM)//   {//    // Change input method.//    ip.CurrentInputMethod = imc[i];////    break;//   }//  }

 }
}
}

Vererbungshierarchie

System.Object
  Microsoft.WindowsCE.Forms.InputPanel.InputMethodCollection

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic)-Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Plattformen

Windows CE, Windows Mobile für Smartphone, Windows Mobile für Pocket PC

Die .NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET framework.

Versionsinformationen

.NET Compact Framework

Unterstützt in: 3.5, 2.0

Siehe auch

Referenz

Member InputPanel.InputMethodCollection

Microsoft.WindowsCE.Forms-Namespace

Weitere Ressourcen

InputPanel-Komponente

SO WIRD'S GEMACHT: Verwenden der InputPanel-Komponente