datetimepicker - set hours and minutes

  • Thread starter Thread starter andreas
  • Start date Start date
A

andreas

Hi,
I have a datetimepicker , format set to time
and two strings, the first give me a hour lke "5" and the other the minutes
like "15"
How can i put these two values in the datetimepicker ?
Thanks for any response
 
Andreas,
Have you tried

Dim picker as DateTimePicker

picker.Value = New DateTime(0, 0, 0, 9, 30, 0)

To set the DateTimePicker to 9:30 AM.

In other words set the Value property to a DateTime that has only a Time in
it.

Hope this helps
Jay
 
* "andreas said:
I have a datetimepicker , format set to time
and two strings, the first give me a hour lke "5" and the other the minutes
like "15"
How can i put these two values in the datetimepicker ?

\\\
Dim d As Date = Me.DateTimePicker1.Value
Me.DateTimePicker1.Value = New Date(d.Year, d.Month, d.Day, CInt("5"), CInt("15"), 0)
///

Set the datetimepicker's 'Format' property to 'Custom' and the
'CustomFormat' property to a string containing "HH:mm".
 
Back
Top