i vote for my idea if the datetime value changes. if it is a constant then i vote for jmc. "easiest to implement" scares me.
btw - don't use focus. if you need to give focus to a control use .Select
Code:Dim s As String = "7/29/09 08:00" myPicker.Format = DateTimePickerFormat.Custom myPicker.CustomFormat = "MM/dd/yyyy hh:mm:ss tt" If DateTime.TryParse(s, myPicker.Value) Then 'string was a valid datetime format Debug.WriteLine("OK " & myPicker.Value.ToString) Else 'bad datetime Debug.WriteLine("BAD " & myPicker.Value.ToString) End If myPicker.Select()




Reply With Quote