Posted By

keidash on 04/25/10


Tagged

language GlobalCulture


Versions (?)

Change the Language of your application


 / Published in: VB.NET
 

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.

  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  

You need to login to post a comment.