开发者

Custom Formating a DateTimePicker using CultureInfo

I am using the DateTimePicker control in a Vb.Net Windows project.

I would like the date to reflect the Regional Settings on the user's computer, but also to show the month name, rather than the month number.

For example, if my computer is set to English(US), I would like to see Nov 26 2009, and if my computer is set to English (NZ), I would like to see 26 Nov 2009

Is this possible?

I know that I can set the CustomFormat property to say "dd MMM yyyy", but then that always shows 26 Nov 2009, even with the regional setting of English(US).

Is there someway I ca开发者_JAVA技巧n use the CultureInfo.CurrentCulture to set the date for all cultures? (i.e. not just a select case statement that sets the CustomFormat based on the CurrentCulture).

Thanks.


Saw this new article on CodeProject that may help:

Culture Aware Month Calendar and Datepicker

Note that control is in C#, but of course you can use the DLL in your VB project.

It looks like what you need though I haven't tried it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜