private void dateTimePicker_ValueChanged(object sender, EventArgs e) { if (iniPro) { return; } DateTimePicker dtp = ( DateTimePicker )sender; buttonEnabled(); if (DHandling.CheckPastTheDeadline(dtp.Value, clsArray, Conv.OfficeCode)) { buttonDisEnabled(); } if (preReportDate != dtp.Value.StripTime()) { Func <DialogResult> dialogOverLoad = DMessage.DialogOverLoad; if (dialogOverLoad() == DialogResult.No) { dtp.Value = preReportDate; return; } } selectPaymentData(dataGridView1, dateTimePickerEx1.Value.EndOfMonth(), Conv.OfficeCode, Conv.DepartCode); }