Hello All,
I am here with the same Query but with a different look
I want to apply the culture change to my program.
I created a class library for culture change. and applied it .
It is only working with the form name, i did it with two different languages and got the result.
But the controls inside the form remains as it is.
Please help.

Edited by AntonyLini: n/a

8 Years
Discussion Span
Last Post by AntonyLini

Add a sub like

Sub ApplyCulture(Byval SelectedCulturename as String)
	Dim Rm As New Resources.ResourceManager("YourProject.YourFormClass", System.Reflection.Assembly.GetExecutingAssembly())
	Dim Ci As System.Globalization.CultureInfo = New System.Globalization.CultureInfo(SelectedCultureName)
	Me.Text = Rm.GetString("$this.Text", Ci)
.	' you need to do this for all controls having a distinct text depending on the language
	Me.btnWhatItWas.Text = Rm.GetString("btnWhatItWas.Text", Ci)
End Sub

Then call this sub at the load event of the form. Also when you want to change the interface language.

Hope this helps


Thanks for your reply
But scenario is little bit different.
this code is not dynamic.
to make it dynamic I created a Class library
and inside that I did the things you mentioned and used a code to get the controls of form dynamically.
It works with perferctly in demo project I got from web.
but when i tried to make my own program, I did all those things related to culture exactly similar to the demo project.
The thing is My form title is changing.
but the controls text is not changing.

Dim fields As FieldInfo() = form.[GetType]().GetFields(BindingFlags.Instance Or BindingFlags.DeclaredOnly Or BindingFlags.NonPublic)

This code returns exact name of controls in demo project.

but in my program and underscore is prefixed like '_controlName'.


Did you already tryed:

For each C as Control In Form.Controls
'    Do here what you need for each control



Hello lolafuertes,
Thank you for your reply.
it works.
Thank you very much.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.