Export (0) Print
Expand All

InputLanguageChangedEventArgs.CharSet Property

Gets the character set associated with the new input language.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public byte CharSet { get; }

Property Value

Type: System.Byte
An 8-bit unsigned integer that corresponds to the character set, as shown in the following table.

Character Set

Value

ANSI_CHARSET

0

DEFAULT_CHARSET

1

SYMBOL_CHARSET

2

MAC_CHARSET

77

SHIFTJI_CHARSET

128

HANGEUL_CHARSET

129

HANGUL_CHARSET

129

JOHAB_CHARSET

130

GB2312_CHARSET

134

CHINESEBIG5_CHARSET

136

GREEK_CHARSET

161

TURKISH_CHARSET

162

VIETNAMESE_CHARSET

163

HEBREW_CHARSET

177

ARABIC_CHARSET

178

BALTIC_CHARSET

186

RUSSIAN_CHARSET

204

THAI_CHARSET

222

EASTEUROPE_CHARSET

238

OEM_CHARSET

255

This property is the Win32 character set that the user switched to. On ANSI systems, this property can be used to create fonts that can display the correct character set. On Unicode systems, you typically do not need to use this property. Instead, use the CultureInfo class for these functionalities.

The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the Form.InputLanguageChanged event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing MessageBox.Show with Console.WriteLine or appending the message to a multiline TextBox.

To run the example code, paste it into a project that contains an instance of type Form named Form1. Then ensure that the event handler is associated with the Form.InputLanguageChanged event.


private void Form1_InputLanguageChanged(Object sender, InputLanguageChangedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "InputLanguage", e.InputLanguage );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Culture", e.Culture );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "CharSet", e.CharSet );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "InputLanguageChanged Event" );
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft