Question

I'm about ready to start tearing out what little is left of my hair over this.

I am working on a winforms application (.NET 3.5) under windows 7. In this application is a custom datepicker control which uses MonthCalendar for the actual date picking. It is working and looking great with the exception of the 'Today' date shown at the bottom. It has the label 'Today' next to it. This is fine if your audience is native english speakers. Mine is danish.

When the culture is set to danish, the 'Today' label remains unchanged while week and month names and date format obey the relevant windows settings. It is a minor niggle, but still an annoying one.

Has anyone else seen this? Does anyone know what I am doing wrong? Failing that, does anyone know of a workaround?

Was it helpful?

Solution

Your Danish customers will run the Danish version of Windows. Which uses Danish text for "Today". Changing the culture on your machine does not otherwise change the language of native Windows resources, like the ones used by MonthCalendar.

So this is not a real problem. If you have to make it look genuine, for screen shots for example, then purchase a license for the Ultimate edition of Windows. Which allows installing language packs that modify those native resources. Or use an MSDN subscription to get access to the Danish Windows version.

OTHER TIPS

The 'Today' label reflects the language of the operating system in the Control Panel (Region and Language), see Image below.

You are pretty much screwed, since this is baked into the Windows Forms library, and you cannot override/hide/set private field to fix this problem. This is the same in .NET 4.0.

A workaround is to hide the Today label on the MonthCalendar and create a UserControl with a MonthCalendar in it that mimicks the Today button but displays the text in the correct language.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top