I would like to assign yesterday's day as Start Date every time my program was started in a dateTimePicker

2
  • I can assign value to it just do not know how to assign a yesterday

    private void Form1_Load(object sender, EventArgs e)
    {
      dateTimePicker1.Value = DateTime.Today;
    }
    
  • asked by anonymous 24.08.2018 / 16:18

    1 answer

    4
    dateTimePicker1.Value = DateTime.Today.AddDays(-1);
    
        
    24.08.2018 / 16:20