Store time in numeric up down

I want to store time in a numeric up down control. The reason is a date time picker will always show a value. I use a similar style with a combobox and a month calendar for the date. How do I set the time for a numeric up down to now? Or any other ideas?
LVL 13
wiswalldAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
>> The reason is a date time picker will always show a value
Don't understand!
Why don't you use a datetimepicker and select Format = Time and ShowUpDown = True ?
0
wiswalldAuthor Commented:
It is going to be possible that they may leave a time field blank. The date time picker will not allow that. I have read about using the checkbox but that seems kind of cheap.
0
Jorge PaulinoIT Pro/DeveloperCommented:
>> The date time picker will not allow
Humm, that is your problem!
Do you want to use a datetimepicker and use a blank field ? Is the datetimepicker bound or unbound ?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

wiswalldAuthor Commented:
I really don't care. What I have so far is a combobox where a user clicks and the mouse down opens a month calendar. After selecting a date the date combobox is filled and the time combobox is filled. However the time may not be Now() so I want an up down ability to change the time like the numeric up down or date and time picker. Also they may not select a date in the date combobox so I cannot use the date time picker (I don't think) because it will show Now() for the time and I may want it blank.
0
Jorge PaulinoIT Pro/DeveloperCommented:
Ok, but have you changed the datetimepicker to Format = Time and ShowUpDown = True  ?
You can use one for the date and other for the time.
0
wiswalldAuthor Commented:
Ok, but have you changed the datetimepicker to Format = Time and ShowUpDown = True  ?

Yes

But it still defaults to time of Now()
0
Jorge PaulinoIT Pro/DeveloperCommented:
You can define the format you want and you can set the time you need
Example:

Me.DateTimePicker1.Format = DateTimePickerFormat.Custom
Me.DateTimePicker1.CustomFormat = "HH:mm"
Me.DateTimePicker1.Value = New DateTime(2008, 11, 13, 10, 10, 10)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.