简体   繁体   中英

How do I set a DateTimePicker to default value with my reset Button?

This is my reset Button:

private void resetuj()
{
      tbID.Clear();
      tbIme.Clear();
      tbPrezime.Clear();
      cbUcesnik.SelectedIndex = -1;
      cbProgrami.SelectedIndex = -1;
      dateTimePicker1.Value.
}

if you want to set dateTimePicker1 value, you need to change "2020/12/03" and here write your date.

‍‍dateTimePicker1.Value = DateTime.Parse("2020/12/03");

if you want to dateTimePicker1 default value, then

dateTimePicker1.Value = DateTime.Now;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM