How to cancel DateTimePicker event?# DotNet - 窗口里的风景
c*t
1 楼
There are two dateTimePickers on a winform, which requires dt2 > dt1;
if dt1 is picked greater than dt2, reset dt1 to dt2-1; but the messagebox
pops
out twice. How to disable the second one? ..EnableEvents seems not working
//The code is as follows.
private void dateTimePicker2_ValueChanged(object sender, EventArgs e)
{
if (this.dateTimePicker1.Value > this.dateTimePicker2.Value)
{
MessageBox.Show("This date should NOT be earlier then " +
this.dateTimeP
if dt1 is picked greater than dt2, reset dt1 to dt2-1; but the messagebox
pops
out twice. How to disable the second one? ..EnableEvents seems not working
//The code is as follows.
private void dateTimePicker2_ValueChanged(object sender, EventArgs e)
{
if (this.dateTimePicker1.Value > this.dateTimePicker2.Value)
{
MessageBox.Show("This date should NOT be earlier then " +
this.dateTimeP