I want 1/20/2007. I get 1/20/2007 4:44:45 AM. Here is the code I'm using:
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged
Dim dt As DateTimePicker = sender
Dim str As String
'TextBox1.Text = Format$("{0:d}", dt.Value.ToString)
'TextBox1.Text = Format$("{0:M d,yyyy}", dt.Value.ToString)
'TextBox1.Text = Format$("{0:m d,yyyy}", dt.Value.ToString)
'str = Format$("{0:m d,yyyy}", dt.Value)
str = dt.Value.ToString
TextBox1.Text = str.Substring(0, InStr(str, " ") - 1)
End Sub
As you can see I have tried several ways but the time shows up in all but manualy taking the time out. As a matter of fact I don't even need the format to show the date like I want it. Or should I not use the datetimepicker at all, maybe something else
I have thought about setting up a dialog box where the month, day and year can be selected and returned like I want.