How can I change the calendar culture programmatically

  • Thread starter Thread starter gh0st54
  • Start date Start date
G

gh0st54

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 ?

It has to be possible

thanks
 
gh0st54 said:
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 ?

It has to be possible

thanks

You can set system.Threading.Thread.CurrentThread.CurrentCulture to the
culture you want.

This doesn't give you fine-grained control, but it might be all you need.

If you need more fine-grained control, you'll probably have to derive a
new class from Calendar, add a Culture property, and set/reset the
CurrentCulture at the appropriate times.
 
Thanks Mikeb

but the problem is I'm already using the thread to set up the culture

I use resources files to change the text in my labels everything is
fine except the calendar.

the calendar has non property to change the culture.
if you change it in the page params, the calendar takes the right
culture.

do you have a code sample to show me how to derive from the calendar
control
to properly get the other culture i'm looking for.

thanks
 
Back
Top