Form

GPALDateTimePicker

Everything on Settings Every Control Takes applies here too. GPAL.DateTimePicker builds one. WithValue sets the date it starts on. WithFormat picks the display format, Long, Short, Time or Custom, and WithCustomFormat supplies the format string Custom uses. ValueChanged is the primary event. GPAL.DateTimePickerFor(value) is the shorthand.

NOTE

Value reads the control as it stands, so it reflects whatever the user picked. WithValue sets what it starts on. Before the form is shown there is no control to read and Value gives back the starting value.

Examples

GPAL Fluent: High-level fluent C# API

//WithCustomFormat only takes effect with WithFormat(DateTimePickerFormat.Custom); on any other format the string is ignored.

GPALDateTimePicker runAt = (GPALDateTimePicker)GPAL.DateTimePicker

.WithValue(DateTime.Today.AddDays(1))

.WithFormat(DateTimePickerFormat.Custom)

.WithCustomFormat("yyyy-MM-dd HH:mm")

.WithCallback<EventHandler>(WhenChanged).ForEvent(ControlEventType.ValueChanged)

.WithName("runAt");

💬 Ask GPAL