Change the Language of your application


/ Published in: VB.NET
Save to your folder(s)

This code is applicable only before that the primari form (MDI) charge. In the form, you need to make various resources, one for each languaje. Go to language properti on MDI form, select the language that you need aplicate, and then, you make 1 resource. In this point, change all controls text in the language that you select.

When your finish, select again other language, and make the same process again. For each language, one resource.


Copy this code and paste it in your HTML
  1. Public Sub New()
  2. 'Get the language from settings for example:
  3. 'You can get info of CultureInfo Class con MSDN or on 'http://www1.cs.columbia.edu/~lok/csharp/refdocs/System.Globalization/types/CultureInfo.html
  4.  
  5. Dim lLng As String = My.Settings.Languaje 'es-Es for example
  6.  
  7. Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo(lLng)
  8. Threading.Thread.CurrentThread.CurrentUICulture = New CultureInfo(lLng)
  9.  
  10. ' This call is required by the Windows Form Designer.
  11. InitializeComponent()
  12.  
  13. Me.IsMdiContainer = True
  14.  
  15. Initialice()
  16.  
  17. End Sub

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.