Sub Button1_Click
Dim Dd As DateDialog
Dim thedate As String
Dd.Year = DateTime.GetYear(DateTime.Now)
Dd.Month = DateTime.GetMonth(DateTime.Now)
Dd.DayOfMonth = DateTime.GetDayOfMonth(DateTime.Now)
ret = Dd.Show("Set the required date", "Date Dialog", "OK", "Cancel", "", Bmp)
thedate = Dd.Year & "-" & Dd.Month & "-" & Dd.DayOfMonth
DateTime.DateFormat = "yyyy-mm-dd"
Label1.Text= thedate
End Sub