I can't get the datetimepicker text to show the abbreviation for the month in another language
I changed the regional settings for my PC to Dutch. That changes the month name from May to mei but I don't want to do that.
On start application:
CultureInfo.CurrentCulture = New CultureInfo("en-US", False)
ElseIf TypeOf a Is DateTimePicker Then
If TableDataString(index) IsNot Nothing And TableDataString(index) <> "" Then
Dim dt As Date = TableDataString(index).ToString
TryCast(a, DateTimePicker).Format = DateTimePickerFormat.Custom
TryCast(a, DateTimePicker).CustomFormat = "dd-MMM-yyyy"
TryCast(a, DateTimePicker).Text = dt
Else
Dim dt As Date
TryCast(a, DateTimePicker).Format = DateTimePickerFormat.Custom
TryCast(a, DateTimePicker).CustomFormat = " - - "
TryCast(a, DateTimePicker).Text = dt
End If
To change the date in a textbox I can do:
textbox.Text = result.ToString("dd-MMM-yyyy", New Globalization.CultureInfo("nl"))
This is not working
TryCast(a, DateTimePicker).Text = dt.ToString("dd-MMM-yyyy", New Globalization.CultureInfo("nl"))
I like May to show mei