Freigeben über


Encoding and Windows Forms Globalization

Windows Forms applications are entirely Unicode-enabled, meaning that each character is represented by a unique number, no matter what the platform, program, or language. For more information about Unicode, see the Unicode consortium Web site (http://www.unicode.org/).

Benefits of Unicode

The benefits of Unicode-enabled forms include the ability to work with scripts that are Unicode-only, such as Hindi. In addition, you can use multiple languages on a single form. In Unicode, all characters are two bytes long, so no special effort is needed to represent double-byte characters. You can also write a single set of code that will work on all platforms. This is a change from previous versions of Visual Basic, in which you had to write different code for different platforms, such as Windows NT and Windows 98.

However, certain controls do not support Unicode in Windows 98 and Windows Millennium Edition. These controls, all of which inherit from the common control, will process data with the Windows code pages, as ANSI. These controls are: TabControl, ListView, TreeView, DateTimePicker, MonthCalendar, TrackBar, ProgressBar, ImageList, ToolBar, and StatusBar. As a result, you cannot display Unicode data in these controls on the listed platforms. For example, you cannot display Japanese characters on an English Windows 98 operating system.

For Unicode-aware alternatives to the ToolBar and StatusBar controls, use the ToolStrip and StatusStrip controls, which replace these older controls. To maintain a similar look and feel between visual elements in your application, use the MenuStrip control for rendering menus instead of MainMenu. Like ToolStrip and StatusStrip, MenuStrip can also process and display Unicode characters.

See Also

Other Resources

Globalizing Windows Forms