问题
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 can 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.
回答1:
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.
来源:https://stackoverflow.com/questions/1836354/custom-formating-a-datetimepicker-using-cultureinfo