I am trying to set the time on my DateTimePicker value to "8:00 AM" on Form Load (using vb.net) but can't work out how to do it.
I have tried setting the value in the properties of my DateTimePicker to "8:00 AM" but on Form Load it keeps on reverting to the current time.
Current time displayed
I have also tried setting the values on Form Load but now get error
DateTimePicker.Value = Date.Now("8:00 AM")
Try this code. it will work
Dim dtval As String = "8:00 AM" dtppick.Value = Convert.ToDateTime(dtval)