This would do it.
public partial class MyFirstProject : Form {
int daysToShow;
public MyFirstProject() {
InitializeComponent();
UpdatePeriod();
}
void ckBox_CheckStateChanged(object sender, EventArgs e) {
UpdatePeriod();
UpdateLabel();
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e) {
UpdateLabel();
}
private void UpdatePeriod() {
daysToShow = ckBox.Checked ? -20 : -10;
}
private void UpdateLabel() {
label20Day.Text = dateTimePicker1.Value.AddDays(daysToShow).ToString("MM/dd/yyyy");
}
}