我使用此代码将此日期时间选择器格式化为
#Region "date time picker"
With .dtpDate1
.Format = DateTimePickerFormat.Custom
.CustomFormat = "MM/dd/yyyy"
End With
With .dtpDate2
.Format = DateTimePickerFormat.Custom
.CustomFormat = "MM/dd/yyyy"
End With
#End Region
问题是我无法将文字居中04/21/2016
。
问题:我该如何居中?
答案 0 :(得分:0)
这是一个很旧的线程,我的解决方案不是最干净的,但这可能有助于有人研究这个问题。
使用静态日期时间选择器时它对我很有用:
为您的自定义格式添加必要数量的空格:
.CustomFormat = " MM/dd/yyyy"
I found this trick in rv88's comment on Wednesday, June 7, 2017 5:12 PM here