How can I change the calendar culture programmatically

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
 
M

mikeb

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.
 
G

gh0st54

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top