using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace DBUtility { public partial class FrmSelectDate : Form { public FrmSelectDate() { InitializeComponent(); } public bool isSelected = false; public DateTime sDate; private void MC1_DateSelected(object sender, DateRangeEventArgs e) { isSelected = true; this.Hide(); } private void FrmSelectDate_Activated(object sender, EventArgs e) { if (sDate < Convert.ToDateTime("1901-01-01")) { MC1.SelectionStart = DateTime.Today; MC1.SelectionEnd = DateTime.Today; } else { MC1.SelectionStart = sDate; MC1.SelectionEnd = sDate; } isSelected = false; } } }