473,395 Members | 1,521 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,395 software developers and data experts.

Viewing Calendar in a different culture is not working

Hello,

I want to view the calendar in another culture, for example let it show in
Arabic. I use this code in the Main, but the calendar is still in the same
culture:

CultureInfo sa = new CultureInfo("ar-SA", false);
sa.DateTimeFormat.Calendar = new System.Globalization.HijriCalendar();
// Sets the culture to Arabic (Saudi Arabia)
Thread.CurrentThread.CurrentCulture = sa;
// Sets the UI culture to Arabic (Saudi Arabia)
Thread.CurrentThread.CurrentUICulture = sa;

I add the DateTimePicker on a form and expect that it shows the date in
Arabic after running. But the DateTimePicker or Calendar is not changed to
that culture.
--
Mike
May 26 '06 #1
6 6890
DateTimePicker and MonthCalendar are hardcoded to use the culture of the
current user (as set in Regional Settings in control panel). This is not a
..NET issue. The problem is in the corresponding Win32 controls.

/claes
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
Hello,

I want to view the calendar in another culture, for example let it show in
Arabic. I use this code in the Main, but the calendar is still in the same
culture:

CultureInfo sa = new CultureInfo("ar-SA", false);
sa.DateTimeFormat.Calendar = new System.Globalization.HijriCalendar();
// Sets the culture to Arabic (Saudi Arabia)
Thread.CurrentThread.CurrentCulture = sa;
// Sets the UI culture to Arabic (Saudi Arabia)
Thread.CurrentThread.CurrentUICulture = sa;

I add the DateTimePicker on a form and expect that it shows the date in
Arabic after running. But the DateTimePicker or Calendar is not changed to
that culture.
--
Mike

May 30 '06 #2
Hello,
Thank you for the help. This is a good way. I was wondering if I could make
the calendar show the date in the same culture. For example, I change the
regional to Turkish, in control panel, and when I click the DateTimePicker it
shows the date in English, but Turkish format.
--
Mike
"Claes Bergefall" wrote:
DateTimePicker and MonthCalendar are hardcoded to use the culture of the
current user (as set in Regional Settings in control panel). This is not a
..NET issue. The problem is in the corresponding Win32 controls.

/claes
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
Hello,

I want to view the calendar in another culture, for example let it show in
Arabic. I use this code in the Main, but the calendar is still in the same
culture:

CultureInfo sa = new CultureInfo("ar-SA", false);
sa.DateTimeFormat.Calendar = new System.Globalization.HijriCalendar();
// Sets the culture to Arabic (Saudi Arabia)
Thread.CurrentThread.CurrentCulture = sa;
// Sets the UI culture to Arabic (Saudi Arabia)
Thread.CurrentThread.CurrentUICulture = sa;

I add the DateTimePicker on a form and expect that it shows the date in
Arabic after running. But the DateTimePicker or Calendar is not changed to
that culture.
--
Mike


May 31 '06 #3
That shouldn't happen. If I set my region to Swedish using the control panel
I get Swedish text and format in the calendar, if I set it to US English I
get US text and format and if I set it to Turkish I get Turkish text and
format.

I'm running on a US version of Windows. Maybe there is a difference in
localized versions of Windows

/claes

"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
Hello,
Thank you for the help. This is a good way. I was wondering if I could
make
the calendar show the date in the same culture. For example, I change the
regional to Turkish, in control panel, and when I click the DateTimePicker
it
shows the date in English, but Turkish format.
--
Mike
"Claes Bergefall" wrote:
DateTimePicker and MonthCalendar are hardcoded to use the culture of the
current user (as set in Regional Settings in control panel). This is not
a
..NET issue. The problem is in the corresponding Win32 controls.

/claes
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
> Hello,
>
> I want to view the calendar in another culture, for example let it show
> in
> Arabic. I use this code in the Main, but the calendar is still in the
> same
> culture:
>
> CultureInfo sa = new CultureInfo("ar-SA", false);
> sa.DateTimeFormat.Calendar = new System.Globalization.HijriCalendar();
> // Sets the culture to Arabic (Saudi Arabia)
> Thread.CurrentThread.CurrentCulture = sa;
> // Sets the UI culture to Arabic (Saudi Arabia)
> Thread.CurrentThread.CurrentUICulture = sa;
>
> I add the DateTimePicker on a form and expect that it shows the date
> in
> Arabic after running. But the DateTimePicker or Calendar is not changed
> to
> that culture.
>
>
> --
> Mike


May 31 '06 #4
Hello,

Thank you for your help. I am using US version of Windows 2003 Server.

I meant when I click on the DateTimePicker down arrow and it opens, the
title is in Turkish but the date is in Gregorian date, not the localized
date. But when I select the Gregorian date, it converts the date to Turkish
date and shows it in Turkish in the test box, then if I click the down arrow
and open it it converts it to Gregorian date again. But I was wondering if
yours is the same, or everything is in Turkish date?
--
Mike
"Claes Bergefall" wrote:
That shouldn't happen. If I set my region to Swedish using the control panel
I get Swedish text and format in the calendar, if I set it to US English I
get US text and format and if I set it to Turkish I get Turkish text and
format.

I'm running on a US version of Windows. Maybe there is a difference in
localized versions of Windows

/claes

"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
Hello,
Thank you for the help. This is a good way. I was wondering if I could
make
the calendar show the date in the same culture. For example, I change the
regional to Turkish, in control panel, and when I click the DateTimePicker
it
shows the date in English, but Turkish format.
--
Mike
"Claes Bergefall" wrote:
DateTimePicker and MonthCalendar are hardcoded to use the culture of the
current user (as set in Regional Settings in control panel). This is not
a
..NET issue. The problem is in the corresponding Win32 controls.

/claes
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
> Hello,
>
> I want to view the calendar in another culture, for example let it show
> in
> Arabic. I use this code in the Main, but the calendar is still in the
> same
> culture:
>
> CultureInfo sa = new CultureInfo("ar-SA", false);
> sa.DateTimeFormat.Calendar = new System.Globalization.HijriCalendar();
> // Sets the culture to Arabic (Saudi Arabia)
> Thread.CurrentThread.CurrentCulture = sa;
> // Sets the UI culture to Arabic (Saudi Arabia)
> Thread.CurrentThread.CurrentUICulture = sa;
>
> I add the DateTimePicker on a form and expect that it shows the date
> in
> Arabic after running. But the DateTimePicker or Calendar is not changed
> to
> that culture.
>
>
> --
> Mike


May 31 '06 #5
Not sure what you're looking for. I thought Turkey used the Gregorian
calendar. The DateTimePicker doesn't do any conversion when I test it
(everything is a gregorian date as fas as I can tell). Can you give an
example date and what it gets converted to/from (and also what you'ld want
it to be)?

/claes

"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
Hello,

Thank you for your help. I am using US version of Windows 2003 Server.

I meant when I click on the DateTimePicker down arrow and it opens, the
title is in Turkish but the date is in Gregorian date, not the localized
date. But when I select the Gregorian date, it converts the date to
Turkish
date and shows it in Turkish in the test box, then if I click the down
arrow
and open it it converts it to Gregorian date again. But I was wondering if
yours is the same, or everything is in Turkish date?
--
Mike
"Claes Bergefall" wrote:
That shouldn't happen. If I set my region to Swedish using the control
panel
I get Swedish text and format in the calendar, if I set it to US English
I
get US text and format and if I set it to Turkish I get Turkish text and
format.

I'm running on a US version of Windows. Maybe there is a difference in
localized versions of Windows

/claes

"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
> Hello,
> Thank you for the help. This is a good way. I was wondering if I could
> make
> the calendar show the date in the same culture. For example, I change
> the
> regional to Turkish, in control panel, and when I click the
> DateTimePicker
> it
> shows the date in English, but Turkish format.
> --
> Mike
>
>
> "Claes Bergefall" wrote:
>
>> DateTimePicker and MonthCalendar are hardcoded to use the culture of
>> the
>> current user (as set in Regional Settings in control panel). This is
>> not
>> a
>> ..NET issue. The problem is in the corresponding Win32 controls.
>>
>> /claes
>>
>>
>> "Mike9900" <Mi******@discussions.microsoft.com> wrote in message
>> news:49**********************************@microsof t.com...
>> > Hello,
>> >
>> > I want to view the calendar in another culture, for example let it
>> > show
>> > in
>> > Arabic. I use this code in the Main, but the calendar is still in
>> > the
>> > same
>> > culture:
>> >
>> > CultureInfo sa = new CultureInfo("ar-SA", false);
>> > sa.DateTimeFormat.Calendar = new
>> > System.Globalization.HijriCalendar();
>> > // Sets the culture to Arabic (Saudi Arabia)
>> > Thread.CurrentThread.CurrentCulture = sa;
>> > // Sets the UI culture to Arabic (Saudi Arabia)
>> > Thread.CurrentThread.CurrentUICulture = sa;
>> >
>> > I add the DateTimePicker on a form and expect that it shows the
>> > date
>> > in
>> > Arabic after running. But the DateTimePicker or Calendar is not
>> > changed
>> > to
>> > that culture.
>> >
>> >
>> > --
>> > Mike
>>
>>
>>


Jun 1 '06 #6
Hello,

I thinkg I found the problem, Thank you very much for the help.
--
Mike
"Claes Bergefall" wrote:
Not sure what you're looking for. I thought Turkey used the Gregorian
calendar. The DateTimePicker doesn't do any conversion when I test it
(everything is a gregorian date as fas as I can tell). Can you give an
example date and what it gets converted to/from (and also what you'ld want
it to be)?

/claes

"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
Hello,

Thank you for your help. I am using US version of Windows 2003 Server.

I meant when I click on the DateTimePicker down arrow and it opens, the
title is in Turkish but the date is in Gregorian date, not the localized
date. But when I select the Gregorian date, it converts the date to
Turkish
date and shows it in Turkish in the test box, then if I click the down
arrow
and open it it converts it to Gregorian date again. But I was wondering if
yours is the same, or everything is in Turkish date?
--
Mike
"Claes Bergefall" wrote:
That shouldn't happen. If I set my region to Swedish using the control
panel
I get Swedish text and format in the calendar, if I set it to US English
I
get US text and format and if I set it to Turkish I get Turkish text and
format.

I'm running on a US version of Windows. Maybe there is a difference in
localized versions of Windows

/claes

"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
> Hello,
> Thank you for the help. This is a good way. I was wondering if I could
> make
> the calendar show the date in the same culture. For example, I change
> the
> regional to Turkish, in control panel, and when I click the
> DateTimePicker
> it
> shows the date in English, but Turkish format.
> --
> Mike
>
>
> "Claes Bergefall" wrote:
>
>> DateTimePicker and MonthCalendar are hardcoded to use the culture of
>> the
>> current user (as set in Regional Settings in control panel). This is
>> not
>> a
>> ..NET issue. The problem is in the corresponding Win32 controls.
>>
>> /claes
>>
>>
>> "Mike9900" <Mi******@discussions.microsoft.com> wrote in message
>> news:49**********************************@microsof t.com...
>> > Hello,
>> >
>> > I want to view the calendar in another culture, for example let it
>> > show
>> > in
>> > Arabic. I use this code in the Main, but the calendar is still in
>> > the
>> > same
>> > culture:
>> >
>> > CultureInfo sa = new CultureInfo("ar-SA", false);
>> > sa.DateTimeFormat.Calendar = new
>> > System.Globalization.HijriCalendar();
>> > // Sets the culture to Arabic (Saudi Arabia)
>> > Thread.CurrentThread.CurrentCulture = sa;
>> > // Sets the UI culture to Arabic (Saudi Arabia)
>> > Thread.CurrentThread.CurrentUICulture = sa;
>> >
>> > I add the DateTimePicker on a form and expect that it shows the
>> > date
>> > in
>> > Arabic after running. But the DateTimePicker or Calendar is not
>> > changed
>> > to
>> > that culture.
>> >
>> >
>> > --
>> > Mike
>>
>>
>>


Jun 2 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: reidarT | last post by:
Is it possible to control the calendar with Culture Info. Actually the name of the days and months. And how do I activate it_ regards Reihaa
3
by: gh0st54 | last post by:
Hi I have created a custom web control wich uses a couple of labels, txtbox and calendars I can change the culture of the txt and lbl no problem , how can I do the same for the calendars ? ...
2
by: Maziar Aflatoun | last post by:
Hi everyone, ..NET Calendar control treats all dates in the format of MM/DD/YYYY. Is it possible to change the calendar property to treat date at DD/MM/YYYY? Thank you Maz.
2
by: Boonaap | last post by:
Hi all, In a user control, the user can put the cultureinfo to his preference, choosing between "nl-BE","fr-BE", and "en-US". this way all calendar and datetime properties are set in the right...
3
by: Stu | last post by:
Hi, I am nearing the end of a multilanguage conversion and have just come across a page which has a calendar control on it that needs translating. The current language of the site is stored in a...
1
by: 515331Jack3410 | last post by:
Is it possible to change the Calendar's control days and months names?
1
by: Marin | last post by:
I have some Calendar controls on my asp.net page. My computer (localhost) and my server is in Croatia, Europe. So calendar control have day in week and month caption on Croatian language. I want to...
4
by: Simon | last post by:
By default, days in the calendar control are simply displayed as numbers, I want to show some days in a different color in this control. What is the best way to do that? Thanks very much.
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.