Hans Kesting wrote:
Can I change the language of an existing form on the fly?
Say I have two radiobuttons: "dutch" and "english". When the user
selects one, the form must switch to the selected language.
Is that possible and how?
When I set System.Threading.Thread.CurrentThread.CurrentUICul ture, any
new forms will use the new language. Existing forms keep their language.
Hans Kesting
Change the "CurrentUICulture" just will force the
"ResourceManager.GetString(..)" to return the string in specified
language. Hence, the new open form will load the correct language
strings since the form will call "ResourceManager.GetString(..)" when it
is opened.
It will not automatically change the strings which have been loaded in
the contorls. You need to make a function to reload the strings manually.
In my apps, it has a menu commands to change to different languages. In
the function, it will change the "CurrentUICulture" and then also call a
function to reload all the control strings. The function is basically
same to the "InitializeComponent()" which is generated by VisualStudio IDE.
--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk