469,646 Members | 1,731 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

datetimepicker - set hours and minutes

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

Nov 20 '05 #1
2 18955
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" <an*****@pandora.be> wrote in message
news:Z4**********************@phobos.telenet-ops.be...
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


Nov 20 '05 #2
* "andreas" <an*****@pandora.be> scripsit:
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".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Shaun | last post: by
22 posts views Thread by Drum2001 | last post: by
reply views Thread by =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post: by
1 post views Thread by =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post: by
11 posts views Thread by jessy | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.