Solved

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

Posted on 2009-05-13
6
197 Views
Last Modified: 2013-12-17
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
Comment
Question by:dvplayltd
  • 4
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Wardy_01
ID: 24372703
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
 

Author Comment

by:dvplayltd
ID: 24372740
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
 
LVL 4

Accepted Solution

by:
Wardy_01 earned 500 total points
ID: 24372918
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:dvplayltd
ID: 24373070
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
 
LVL 4

Expert Comment

by:Wardy_01
ID: 24373144
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
 
LVL 4

Expert Comment

by:Wardy_01
ID: 24373150
don't forget to mark the answer so others can benefit :)
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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