[]
By default, the C1DateTimePicker control's time picker displays the time in a long format that includes seconds, but it can also display time in a shorter format. In this topic, you will learn how to change the time format in the designer, in XAML, and in code.
In the Designer
To change the time format, complete the following steps:
In XAML
To change the time format, place TimeFormat="ShortTime" to the <my:C1DateTimePicker> tag so that the markup resembles the following:
<my:C1DateTimePicker TimeFormat="ShortTime">
In Code
To change the time format, complete the following steps:
Open the Window1.xaml.cs page.
Import the following namespace:
Imports C1.WPF.DateTimeEditors
using C1.WPF.DateTimeEditors;
Place the following code beneath the InitializeComponent() method:
C1DateTimePicker1.TimeFormat = C1TimeEditorFormat.ShortTime
c1DateTimePicker1.TimeFormat = C1TimeEditorFormat.ShortTime;
Run the project.
This Topic Illustrates the Following:
In this topic, you set the TimeFormat to ShortTime, which provides a shortened time display. The final result will resemble the following image: