ImeMode 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定值,這個值會決定選取物件時對象的輸入法編輯器 (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
- 繼承
- 屬性
欄位
| 名稱 | 值 | Description |
|---|---|---|
| Inherit | -1 | 繼承父控制的 IME 模式。 |
| NoControl | 0 | 無(預設)。 |
| On | 1 | IME正在進行。 此數值表示 IME 已啟動,且可輸入特定中文或日文字元。 此設定僅適用於日文、簡體中文及繁體中文 IME。 |
| Off | 2 | IME 結果是錯的。 此模式表示 IME 關閉,意即物件行為與英語輸入模式相同。 此設定僅適用於日文、簡體中文及繁體中文 IME。 |
| Disable | 3 | IME 是被停用的。 使用此設定後,使用者無法從鍵盤開啟 IME,且 IME 浮動視窗會被隱藏。 |
| Hiragana | 4 | 平假DBC。 此設定僅適用於日本IME。 |
| Katakana | 5 | 片假名DBC。 此設定僅適用於日本IME。 |
| KatakanaHalf | 6 | 片假名SBC。 此設定僅適用於日本IME。 |
| AlphaFull | 7 | 字母數字雙位元組字元。 此設定僅適用於韓國和日本的IME。 |
| Alpha | 8 | 字母數字單位元組字元(SBC)。 此設定僅適用於韓國和日本的IME。 |
| HangulFull | 9 | 韓文 DBC。 此設定僅適用於韓國IME。 |
| Hangul | 10 | 韓文SBC。 此設定僅適用於韓國IME。 |
| Close | 11 | 以我的經驗,已關閉。 此設定僅適用於中文 IME。 |
| OnHalf | 12 | 以我經驗,HalfShape。 此設定僅適用於中文 IME。 |
範例
以下範例說明 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)允許使用者輸入及編輯中文、日文及韓文字元。 IME 是撰寫中文、日文和韓文文字的重要組成部分。 這些書寫系統的字元數比一般鍵盤能編碼的還多。 這些語言的 IME 使用基礎字元序列來描述單一字元或一組字元,讓你能輸入更多字元。 基本字元可以是韓文音節的組成字母、日文漢字的語音成分,或是中文的各種組合。
這很重要
使用者可以互動式更改 , Control.ImeMode 除非程式已設定為 Disable。 此時使用者將無法使用IME。
當全域輸入模式生效時,Windows 8 會忽略此 ImeMode 特性。 更多資訊請參閱「 切換文字輸入從 Per-Thread 改為每用戶。