Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to change the UI language at run time at user selection in windows application. How can I do that?
Posted

1 solution

set CurrentCulture and CurrentUICulture based on user selection
C#
// Put the using statements at the beginning of the code module
using System.Threading;
using System.Globalization;
// Put the following code before InitializeComponent()
// Sets the culture to French (France)
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
// Sets the UI culture to French (France)
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");


ref :http://msdn.microsoft.com/en-us/library/b28bx3bh(v=vs.110).aspx[^]

If you need to change the culture on button click or menu item selection etc.. check below article
Changing Your Application User Interface Culture On The Fly[^]
And this SO answer How do I change the culture of a WinForms application at runtime[^]
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 17-Jun-14 1:03am    
Correct, a 5.
—SA
DamithSL 17-Jun-14 1:09am    
Thank you SA
Member 10393333 17-Jun-14 1:03am    
thank you...i put this code .but it not work..i need to change language when the button click..so is this possible for it?
DamithSL 17-Jun-14 1:11am    
you must set the culture before the InitializeComponent method is called. check my updated answer for alternative solutions

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900