I would like to assign yesterday as an initial date every time my program is started on a dateTimePicker

Asked

Viewed 45 times

2

  1. I can assign value to it just don’t know how to assign a Yesterday

    private void Form1_Load(object sender, EventArgs e)
    {
      dateTimePicker1.Value = DateTime.Today;
    }
    

1 answer

3


dateTimePicker1.Value = DateTime.Today.AddDays(-1);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.