473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Changing the current thread culture Info not working

Hi,

iam trying to set a culture info different than the current culture info on the system, the code compiles fine, but nothing happens, and the system culture is the one used for the program.

here is the code :

//////////////////////


CultureInfo ci = new CultureInfo("ar-SA"); // arabic Saudi Arabia
ci.DateTimeFormat.Calendar = new HijriCalendar();

Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;


////////////////////

why is it not working? am i missing something?

even if the culture info on the system is "ar-SA" and tried to change the current thread current culture to "en-US", also nothing happens, why????????

thank you
Sep 20 '08 #1
2 6271
Plater
7,872 Expert 4TB
How do you know it did not work? Did you check to see what the property said after?

Did you follow the example given here:
http://msdn.microsoft.com/en-us/libr...ntculture.aspx

I don't think it just "magically" makes everything match that culture, I think you have to code things into a resource file or something. Then depending on the CurrentCulture, it will pull a different value from the resource file(s)
Sep 22 '08 #2
Iam sorry my question was not clear, i meant that when i change the culture info, the calendar is not changing, it is displayed as the regional settings culture.

i found out later that microsoft says that the DateTimePicker control does not depend on .NET classes, it is a windows API, so settings the CurrentUICulture to arabic will not make the calendar arabic.

thank you.
Sep 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Gani Pola | last post by:
Can someone please tell me how I can change the date format (e.g dd/mm/yyyy, mm/dd/yyyy) in a configuration file? In my windows app, I can retrieve the windows setting but not my ASP.NET...
2
by: Alvaro E. Gonzalez V. | last post by:
Hello everybody; Somebody has a simple example of like applying to the change of Globalization to an application MDI with children windows already opened? HEY!!: That "located" properties of...
1
by: Manu | last post by:
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...
3
by: cmrchs | last post by:
Hi, I try to obtain the current culture of a server by executing : string str = Thread.CurrentThread.CurrentCulture.ToString(); Executing this in a console-applicastion results in the...
5
by: Jason L James | last post by:
Hi have two subroutines that change the currentCulture property of my application. I can call either: System.Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo("en-GB") or:
3
by: Gürkan Demirci | last post by:
Hi, i am trying to write Jananese characters with DrawString(). It is not working. The characters a printed as boxes only. How can i change the culture of my windows forms application ? It...
9
by: Edge | last post by:
hi, I am saving the user selected culture in a session variable so I can apply it back to all pages when refreshed and then load the proper .resx values. For that I am using global.asax
2
by: Christian Robert Schulz | last post by:
How can I change the culture/region of the machines ASPNET Account??? In code, I can set it for the threat manually by using system.threading.thread.currentThread.currentUICulture, but there must...
6
by: =?Utf-8?B?Z3JlZw==?= | last post by:
I've got a windows forms application that uses french and english. We're localizing it right now. It does appear to work if I set the language Thread.CurrentThread.CurrentCulture = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.