Jump to content

DateTime Picker

- - - - -

  • Please log in to reply
3 replies to this topic

#1
DeltaCmdr

DeltaCmdr

    Newbie

  • Members
  • Pip
  • 2 posts
How do I hide the seconds in the DateTime Picker. I don't want the user to be able to change the seconds or even see the seconds.

I would like it so that when the application is run in the date time picker it displays at "16:30" instead of "16:30:30"

Please Help :-)

#2
Momerath

Momerath

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 243 posts
dateTimePicker1.Format = DateTimePickerFormat.Custom;

dateTimePicker1.CustomFormat = "HH:mm";


#3
DeltaCmdr

DeltaCmdr

    Newbie

  • Members
  • Pip
  • 2 posts

Momerath said:

dateTimePicker1.Format = DateTimePickerFormat.Custom;

dateTimePicker1.CustomFormat = "HH:mm";

Thanks works great. :-)

#4
Zero_Cool

Zero_Cool

    Learning Programmer

  • Members
  • PipPipPip
  • 65 posts
 DateTime.Now.ToShortTimeString();
works too




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users