ImeMode ImeMode ImeMode ImeMode Enum

定义

指定一个值,该值是用来确定在选定了对象时该对象的输入法编辑器 (IME) 的状态。Specifies a value that determines the Input Method Editor (IME) status of an object when the object is selected.

此 API 支持产品基础结构,不能在代码中直接使用。

public enum class ImeMode
[System.Runtime.InteropServices.ComVisible(true)]
public enum ImeMode
type ImeMode = 
Public Enum ImeMode
继承
属性

字段

Alpha Alpha Alpha Alpha 8

字母数字单字节字符 (SBC)。Alphanumeric single-byte characters(SBC). 此设置仅对朝鲜语和日语 IME 有效。This setting is valid for Korean and Japanese IME only.

AlphaFull AlphaFull AlphaFull AlphaFull 7

字母数字双字节字符。Alphanumeric double-byte characters. 此设置仅对朝鲜语和日语 IME 有效。This setting is valid for Korean and Japanese IME only.

Close Close Close Close 11

IME 已关闭。IME closed. 此设置仅对中文 IME 有效。This setting is valid for Chinese IME only.

Disable Disable Disable Disable 3

IME 被禁用。The IME is disabled. 如果使用此设置,则用户无法从键盘打开 IME,而且 IME 浮动窗口处于隐藏状态。With this setting, the users cannot turn the IME on from the keyboard, and the IME floating window is hidden.

Hangul Hangul Hangul Hangul 10

朝鲜文 SBC。Hangul SBC. 此设置仅对朝鲜语 IME 有效。This setting is valid for the Korean IME only.

HangulFull HangulFull HangulFull HangulFull 9

朝鲜文 DBC。Hangul DBC. 此设置仅对朝鲜语 IME 有效。This setting is valid for the Korean IME only.

Hiragana Hiragana Hiragana Hiragana 4

平假名 DBC。Hiragana DBC. 此设置仅对日语 IME 有效。This setting is valid for the Japanese IME only.

Inherit Inherit Inherit Inherit -1

继承父控件的 IME 模式。Inherits the IME mode of the parent control.

Katakana Katakana Katakana Katakana 5

片假名 DBC。Katakana DBC. 此设置仅对日语 IME 有效。This setting is valid for the Japanese IME only.

KatakanaHalf KatakanaHalf KatakanaHalf KatakanaHalf 6

片假名 SBC。Katakana SBC. 此设置仅对日语 IME 有效。This setting is valid for the Japanese IME only.

NoControl NoControl NoControl NoControl 0

无(默认)。None (Default).

Off Off Off Off 2

IME 已关闭。The IME is off. 此模式指示 IME 已关闭,这意味着该对象的行为方式与英语输入模式相同。This mode indicates that the IME is off, meaning that the object behaves the same as English entry mode. 此设置仅对日语、简体中文和繁体中文 IME 有效。This setting is valid for Japanese, Simplified Chinese, and Traditional Chinese IME only.

On On On On 1

IME 已打开。The IME is on. 此值指示 IME 已打开,可以输入中文或日语特定的字符。This value indicates that the IME is on and characters specific to Chinese or Japanese can be entered. 此设置仅对日语、简体中文和繁体中文 IME 有效。This setting is valid for Japanese, Simplified Chinese, and Traditional Chinese IME only.

OnHalf OnHalf OnHalf OnHalf 12

HalfShape 上的 IME。IME on HalfShape. 此设置仅对中文 IME 有效。This setting is valid for Chinese IME only.

示例

下面的示例演示如何设置控件的ImeMode属性的值。The following example shows how to set the value of a control's ImeMode property.

#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) 允许用户输入和编辑中文、日语和朝鲜语字符。An Input Method Editor (IME) allows users to enter and edit Chinese, Japanese, and Korean characters. IME 是编写中文、日语和朝鲜语脚本的基本组件。The IME is an essential component for writing Chinese, Japanese, and Korean scripts. 这些书写系统包含的字符数多于可为常规键盘编码的字符数。These writing systems have more characters than can be encoded for a regular keyboard. 这些语言的 Ime 使用描述单个字符或一组字符的基本字符序列, 以便您可以输入更大的字符集。The IMEs for these languages use sequences of base characters that describe an individual character or group of characters to allow you to enter a larger set of characters. 基本字符可以是朝鲜语音节中的组成部分、日语汉字字符的拼音组件或中文字符的各种组合。Base characters can be component letters from Hangul syllables, phonetic components for Japanese Kanji characters, or various combinations for Chinese characters.

重要

用户可以交互方式更改, Control.ImeMode除非已通过编程方式将其设置为 "禁用"。The user can interactively change the Control.ImeMode unless it has been programmatically set to Disable. 在这种情况下, 用户将无法使用 IME。In this case, the user will not be able to use the IME.

ImeMode全局输入模式生效时, Windows 8 上的属性会被忽略。The ImeMode property is ignored on Windows 8 when the global input mode is in effect. 有关详细信息, 请参阅切换文本输入从每个线程更改为每用户For more info, see Switch Text Input Changed from Per-Thread to Per-User.

适用于

另请参阅