Hi Le Minh Hai,
I am not sure about the meaning of “automatic�very clearly. Do you want the application to change language once the regional language changes or the application will change after restarting itself? The latter one will be easy to accomplish.
As we all know, if we want to localize our application, we may first create different language resources.
Supposewe want to create Chinese language resource, we will do the following steps:
1. Choose the form, and set the localizable property to true.
2. Set the language to “Chinese (Simplified)�
3. Change the property of the controls which you want to localize. Such as Text property of the labels or buttons.
4. Build the solution. The Chinese language resources will be generated for you.
The last thing we need to do is:
Before the InitializeComponent property, add the following statement. The application will display the language which is set in the control panel.
Code Snippet
Public Sub New()
System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentThread.CurrentCulture
InitializeComponent()
End Sub
It may be difficult for us to change the application language immediatelysince the System.Threading.Thread.CurrentThread.CurrentCulture will not change after the application restarts. However, we can capture the regional languages changed event in our application.
If you have further problems or difficulty in understanding me, please feel free to contact me.
Best Regards,
Bruce Zhou
Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs