• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

Need object for User interface for choose time (hours only in a day).

Hi experts!

  Im using C# 2008 , WinForm NET 2. I need to help  user to enter time in a.m p.m or 0-24 hours style depend of customer regional setting. Best think is which dbl. click to show him available choose, some thing like calendar but only for time.
This time calendar need to have only hour for 1 day, not need to choose minutes and seconds.

 Can you suggest code in C# or additional components?

 Thank you.
0
dvplayltd
Asked:
dvplayltd
  • 4
  • 2
1 Solution
 
Wardy_01Commented:
From your description it sounds like you might benefit from using a little outlook integration if this is a corporate application.
You can reference the outlook com object and drop an outlook view on to your winform then let that handle everything.

or

If you need something above and beyond the functionality provided by outlook you can always do it yourself.
You could use the standard .NET 2.0 calendar control from your toolbar and override the DayRender event to render out a custom look for your given day.

Hopefully this should be what you need :)
Good luck !!!
0
 
dvplayltdAuthor Commented:
hello Wardy 01,

This do not help.I can not be sure Outlook is installed first and second i need user only to choose time, not day. There operation which are do every day and I need user to choose that will do it some range hour - let say from 10 a.m. to 12 a.m.
0
 
Wardy_01Commented:
oh ok ...

In that case I would recommend you use a standard textbox control and combine it with a regular expression validator.

This will force the user to enter a time in a specific format.

Or ...

use 2 drop downs and have 1 for the hour and 1 for the minutes, put all available values in there and then have a submit button that passes that on / moves the user to the next operation.

If you are trying to log something that happens right now then try using the "DateTime.Now" object also you can bind the drop downs to a datetime object for programming use.
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
dvplayltdAuthor Commented:
this is much better .. with combobox . I need only hour, not minutes, so one combobox is OK.

But hope to get something ready .. not I to do it. :-)

Thanks.
0
 
Wardy_01Commented:
no worries :)

Glad I could help !!

Also ...
behind the intereface set the value chosen in a datetime object to allow you to keep and pass the format of the object around in your applcation.

Good Luck !!
0
 
Wardy_01Commented:
don't forget to mark the answer so others can benefit :)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now