如何更改文本框中的日期格式

时间:2012-02-16 03:07:09

标签: vb.net

以下代码以02/15/2012格式显示日期。如何将其更改为15/02/2012

Private Sub Calendar_DateChanged(ByVal sender As System.Object, _
     ByVal e As System.Windows.Forms.DateRangeEventArgs) _
     Handles Calendar.DateChanged
 TxtStock_Date.Text = Calendar.SelectionStart.ToShortDateString
 Calendar.Visible = False
End Sub

1 个答案:

答案 0 :(得分:1)

这应该这样做:

TxtStock_Date.Text = Calendar.SelectionStart.ToString("dd.MM.yyyy")