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 '
  5. Dim lLng As String = My.Settings.Languaje 'es-Es for example
  7. Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo(lLng)
  8. Threading.Thread.CurrentThread.CurrentUICulture = New CultureInfo(lLng)
  10. ' This call is required by the Windows Form Designer.
  11. InitializeComponent()
  13. Me.IsMdiContainer = True
  15. Initialice()
  17. End Sub

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.