Posts

Showing posts from February, 2011

C#- Change form language at runtime.

Image
Recently I was trying to create multi language application in C#. I found a lot of useful information in net. You can always create a resource file and use it for localization: Localization with resource file. It's quite simple, but you always need to change text properties in form constructor... Not useful if we have a lot of forms. Better solution is to localize your form in a designer. Localization in Designer It is easier to localize forms and all code is created by designer. But how we can change language at run time? All procedures described before enables localization changing when new form is created. I'll describe language change at run time in case when forms are localized using Designer. In order to change application language we need to: 1. set a proper CultureInfo mCI = new CultureInfo(language); Thread.CurrentThread.CurrentCulture = mCI; Thread.CurrentThread.CurrentUICulture = mCI; If you want to know all p...