Groups | Blog | Home
all groups > dotnet windows forms > march 2007 >

dotnet windows forms : How to change form language (in code)



Carlos Cruz
3/14/2007 3:39:52 PM
Hi,

I'm trying to make a multilanguage application.
I manage to create the forms resource files for each language and to read
them (rm.GetString("Label1.Text", pCultureInfo)), but I need to change all
objects after changing pCultureInfo.
Is it possible to change the forma language in code? Where? How?
(I see that in designtime when I change the language, all objects are
updated... It might be possible to do it in runtime)

Thanks
CC


Bryan Phillips
3/14/2007 6:53:09 PM
You can change the language displayed at runtime by setting
System.Threading.Thread.CurrentThread.CurrentUICulture to a different
CultureInfo.

To change formatting for dates, currency, etc..., use
System.Threading.Thread.CurrentThread.CurrentCulture.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com



[quoted text, click to view]
AddThis Social Bookmark Button