namespace IBox.WinFrmUI { public partial class AnalyDayForm : Form { public string CurrDateTime { get; set; } public AnalyDayForm() { InitializeComponent(); } private void simpleButton1_Click(object sender, EventArgs e) { this.CurrDateTime = dateEdit1.EditValue.ToString(); DialogResult = DialogResult.OK; this.Close(); } } }