CSharp examples for System.Windows.Forms:DateTimePicker
Combines the selected date and selected time from two DateTimePicker controls
using System.Globalization; using System.Windows.Forms; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*w ww .ja v a 2 s. c o m*/ public class Main{ // ------------------------------------------------------------------------------- // GetDateFromDateTimePickers // Combines the selected date and selected time from two DateTimePicker controls // ------------------------------------------------------------------------------- public static DateTime GetDateFromDateTimePickers(DateTimePicker oDate, DateTimePicker oTime) { DateTime oDateTime = new DateTime( oDate.Value.Year, oDate.Value.Month, oDate.Value.Day, oTime.Value.Hour, oTime.Value.Minute, oTime.Value.Second); return oDateTime; } }