我正在尝试使用dateTimePicker以ddMMMyyyy格式显示日期,但是以大写字母显示,例如01JAN2014,而不是ddMMMyyyy提供的01Jan2014。
为了澄清,我希望dateTimePicker以此(大写)格式显示所选值,而不是简单地从中获取大写结果。
答案 0 :(得分:0)
最简单的方法。
Private Sub Form1_Load(sender As System.Object,e As System.EventArgs)处理MyBase.Load
DateTimePicker1.Format = DateTimePickerFormat.Custom
DateTimePicker1.CustomFormat = Strings.UCase(Format(DateTimePicker1.Value, "ddMMMyyyy"))
End Sub
Private Sub DateTimePicker1_ValueChanged(sender As Object,e As System.EventArgs)处理DateTimePicker1.ValueChanged
DateTimePicker1.CustomFormat = Strings.UCase(Format(DateTimePicker1.Value, "ddMMMyyyy"))
End Sub