ImeMode 列舉

定義

指定數值,決定當選取物件時,該物件的輸入法 (IME) 狀態。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public enum class ImeMode
[System.Runtime.InteropServices.ComVisible(true)]
public enum ImeMode
public enum ImeMode
[<System.Runtime.InteropServices.ComVisible(true)>]
type ImeMode = 
type ImeMode = 
Public Enum ImeMode
繼承
屬性

欄位

Alpha 8

英數單一位元組字元 (SBC)。 這個設定僅適用於韓文和日文輸入法。

AlphaFull 7

英數雙位元組字元。 這個設定僅適用於韓文和日文輸入法。

Close 11

輸入法已關閉。 這個設定僅適用於中文輸入法。

Disable 3

輸入法目前暫止。 設定這個選項時,使用者將無法從鍵盤開啟輸入法,而且輸入法浮動視窗是隱藏的。

Hangul 10

韓文單一位元組字元。 這個設定僅適用於韓文輸入法。

HangulFull 9

韓文雙位元組字元。 這個設定僅適用於韓文輸入法。

Hiragana 4

平假名雙位元組字元。 這個設定僅適用於日文輸入法。

Inherit -1

繼承父控制項的輸入法模式。

Katakana 5

片假名雙位元組字元。 這個設定僅適用於日文輸入法。

KatakanaHalf 6

片假名單一位元組字元。 這個設定僅適用於日文輸入法。

NoControl 0

無 (預設)。

Off 2

輸入法關閉。 這個模式表示輸入法是關閉的,亦即物件的行為模式和英文輸入模式相同。 這個設定僅適用於日文、簡體中文和繁體中文輸入法。

On 1

輸入法開啟。 這個值代表輸入法是開啟的而且可輸入中文和日文字元。 這個設定僅適用於日文、簡體中文和繁體中文輸入法。

OnHalf 12

半形輸入法開啟。 這個設定僅適用於中文輸入法。

範例

下列範例示範如何設定控制項的 ImeMode 屬性值。

#using <System.Data.dll>
#using <System.Windows.Forms.dll>
#using <System.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;
public ref class Form1: public System::Windows::Forms::Form
{
private:
   RichTextBox^ rtb;

public:
   Form1()
   {
      rtb = gcnew RichTextBox;
      this->Controls->Add( rtb );
      rtb->Dock = DockStyle::Fill;
      this->InputLanguageChanged += gcnew InputLanguageChangedEventHandler( this, &Form1::languageChange );
   }


private:
   void languageChange( Object^ /*sender*/, InputLanguageChangedEventArgs^ e )
   {
      
      // If the input language is Japanese.
      // set the initial IMEMode to Katakana.
      if ( e->InputLanguage->Culture->TwoLetterISOLanguageName->Equals( "ja" ) )
      {
         rtb->ImeMode = System::Windows::Forms::ImeMode::Katakana;
      }
   }

};

int main()
{
   Application::Run( gcnew Form1 );
}
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class Form1 : System.Windows.Forms.Form
{
    RichTextBox rtb = new RichTextBox();
    public Form1()
    {
        this.Controls.Add(rtb);
        rtb.Dock = DockStyle.Fill;
        this.InputLanguageChanged += new InputLanguageChangedEventHandler(languageChange);
    }
    private void languageChange(Object sender, InputLanguageChangedEventArgs e)
    {
        // If the input language is Japanese.
        // set the initial IMEMode to Katakana.
        if (e.InputLanguage.Culture.TwoLetterISOLanguageName.Equals("ja"))
        {
            rtb.ImeMode = System.Windows.Forms.ImeMode.Katakana;
        }
    }
    public static void Main(string[] args)
    {
        Application.Run(new Form1());
    }
}
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data

Public Class Form1
   Inherits System.Windows.Forms.Form
   
   Dim WithEvents rtb As New RichTextBox()
   
   Public Sub New()
      MyBase.New()
      Me.Controls.Add(rtb)
      rtb.Dock = DockStyle.Fill
   End Sub

   Private Sub languageChange( _
      ByVal sender As Object, _
      ByVal e As InputLanguageChangedEventArgs _
   ) Handles MyBase.InputLanguageChanged

      ' If the input language is Japanese.
      ' set the initial IMEMode to Katakana.
      If e.InputLanguage.Culture.TwoLetterISOLanguageName.Equals("ja") = True Then
         rtb.ImeMode = System.Windows.Forms.ImeMode.Katakana
      End If
   End Sub

   Public Shared Sub Main()
      Application.Run(new Form1())
   End Sub

End Class

備註

輸入法編輯器 (輸入法) 允許使用者輸入和編輯中文、日文和韓文字元。 輸入法是撰寫中文、日文和韓文腳本的基本元件。 這些寫入系統具有比一般鍵盤編碼更多的字元。 這些語言的 IME 會使用描述個別字元或字元群組的基底字元序列,讓您輸入較大的字元集。 基底字元可以是韓文音節的元件字母、日文中文字元的注音元件,或中文字元的各種組合。

重要

除非已以程式設計方式將其設定為 [停用], Control.ImeMode 否則使用者可以以互動方式變更 。 在此情況下,使用者將無法使用 IME。

ImeMode當全域輸入模式生效時,會忽略Windows 8屬性。 如需詳細資訊,請參閱 將文字輸入從 Per-Thread 變更為個別使用者

適用於

另請參閱