Changing the current thread culture Info not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tamirmalas
    New Member
    • Aug 2008
    • 4

    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.DateTimeForm at.Calendar = new HijriCalendar() ;

    Thread.CurrentT hread.CurrentCu lture = ci;
    Thread.CurrentT hread.CurrentUI Culture = 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
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    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:
    Gets or sets the CultureInfo object that represents the culture used by the current thread and task-based asynchronous operations.


    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)

    Comment

    • tamirmalas
      New Member
      • Aug 2008
      • 4

      #3
      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 CurrentUICultur e to arabic will not make the calendar arabic.

      thank you.

      Comment

      Working...