?
Solved

Store time in numeric up down

Posted on 2008-11-12
7
Medium Priority
?
451 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:wiswalld
  • 4
  • 3
7 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 22944126
>> 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
 
LVL 13

Author Comment

by:wiswalld
ID: 22949130
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
 
LVL 48

Expert Comment

by:jpaulino
ID: 22950169
>> 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 13

Author Comment

by:wiswalld
ID: 22950337
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
 
LVL 48

Expert Comment

by:jpaulino
ID: 22952526
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
 
LVL 13

Author Comment

by:wiswalld
ID: 22953650
Ok, but have you changed the datetimepicker to Format = Time and ShowUpDown = True  ?

Yes

But it still defaults to time of Now()
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 22953807
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question