469,904 Members | 2,482 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

How to change the current thread current culture at run time.

I have created a new culture :
Dim objCulture As New CultureInfo("he") //hebrew

When I tried to assign it to the current thread.

Thread.CurrentThread.CurrentCulture = objCulture
Thread.CurrentThread.CurrentUICulture = objCulture
This Caused an exception :
" Culture "he" is a neutral culture. It can not be used in
formatting and parsing and therefore cannot be set as the
thread's current culture. "
what is the problem ?

Nov 17 '05 #1
1 7348

The right way to set neutral culture is by using CreateSpecificCulture
static function :

System.Threading.Thread.CurrentThread.CurrentCultu re =
System.Globalization.CultureInfo.CreateSpecificCul ture("he");

Neutral cultures are cultures that just the language set, without the

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by cmrchs | last post: by
2 posts views Thread by Joel D Kraft | last post: by
1 post views Thread by Lloyd Dupont | last post: by
6 posts views Thread by bojan.pikl | last post: by
reply views Thread by =?Utf-8?B?RW1pbA==?= | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.