Windows Forms localization demo (VBWinFormLocalization)

The code sample demonstrates how to localize Windows Forms application.

VB.NET (57.0 KB)
3.5 Star
12,974 times
Add to favorites
E-mail Twitter Digg Facebook
       WINDOWS FORMS APPLICATION : VBWinFormLocalization Project Overview


The Windows Forms Localization sample demonstrates how to localize 
Windows Forms application.


1. Create a new Windows Application named "VBWinFormLocalization". 

2. In the Properties window, set the form's Localizable property to true.

3. Drag two Button controls and one Label control from the Windows Forms tab 
   of the Toolbox to the form, and set their Text property as follows:
   button1: "Hello World!",
   button2: "I'm a button.",
   label1 : "I'm a label".
4. Set the form's Language property to Chinese (Simplified Chinese).

5. Set the Text property for the three controls as follows:

   button1: "你好,世界!", 
   button2: "我是一个按钮。", 
   label1 : "我是一个标签。".

6. Save and build the solution.

7. Click the Show All Files button in Solution Explorer. 

   The resource files appear underneath Form1.vb. 
   Form1.resx is the resource file for the default culture.
   Form1.zh-CHS.resx is the resource file for Simplified Chinese as spoken in PRC. 

8. Press Ctrl+F5 to run the application, the buttons and label will display in 
   English or Simplified Chinese depending on the UI language of your o
   perating system. 
9. If you want the form always display in Simplified Chinese, you can set the 
   UI culture to Simplified Chinese before calling the InitializeComponent method.

    Public Sub New()
        Thread.CurrentThread.CurrentUICulture = New CultureInfo("zh-CHS")
    End Sub


1. Walkthrough: Localizing Windows Forms
2. Windows Forms General FAQ.