private void numericUpDownEnd_ValueChanged(object sender, EventArgs e) { if (numericUpDownEnd.Value <= numericUpDownStart.Value) numericUpDownEnd.Value = last_end; else { last_end = (int)numericUpDownEnd.Value; refresh_plot(); } }