Solved

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

Posted on 2009-05-13
6
196 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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