Time picker

Posted on 2007-10-20
Last Modified: 2010-04-23
What is the best way to display a field where the user will select the time?

I used a date and time picker, but when you check time, and click on the drop arrow it shows the date calendar.
Question by:Medrise
    LVL 18

    Expert Comment

    by:Ajay Sharma
    i think there is no time picker avalible.

    U have to make yu own time picker

    just use the datetimepicker to select the date.

    Create two comboboxes to select time, one for hours and secod for minutes.
    keep a timer control active to refresh the combo boxes to update the time values
    LVL 48

    Expert Comment

    Hi Medrise,

    You can use datetimepicker. You can set:
      Format = Time
      ShowUpDown = Turn

    This way you will see the up and down arrows.

    LVL 13

    Expert Comment

    I used a small button next to a textbox with this

     Me.TimeTextBox.Text = DateTime.Now.ToString("HH:mm:ss")
    LVL 48

    Accepted Solution

    Sorry Medrise,

    Set ShowUpDown to True ... not Turn :-)

    You can also use maskedtextbox and define the maks for time.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now