C#dateTimePicker如何显示日期时间?指定日期与时间

C#dateTimePicker如何显示日期时间?指定日期与时间

  private void Form1_Load(object sender, EventArgs e) //by txwtech
        {
            dateTimePicker_start_date.Format = DateTimePickerFormat.Custom;
            dateTimePicker_start_date.CustomFormat = "yyyy-MM-dd HH:mm:ss";
            dateTimePicker_start_date.ShowUpDown = true;
            dateTimePicker_end_date.Format = DateTimePickerFormat.Custom;
             dateTimePicker_end_date.CustomFormat = "yyyy-MM-dd HH:mm:ss";
            // dateTimePicker_end_date.CustomFormat = "yyyy-MM-dd 20:00:00"; //设置当前日期+指定的起始时间
            // dateTimePicker_end_date.CustomFormat = "2022-07-27 20:00:00"; //设置指定的起始日期与时间
            dateTimePicker_end_date.ShowUpDown = true;
            comboBox_modify_type.SelectedIndex = 0;
            comboBox_search_type.SelectedIndex = 2;
            comboBox_after_modify_type.SelectedIndex = 8;
            string aa= Application.ProductVersion.ToString() + "\n";
            this.Text = this.Text + aa;
            HideControls();
            
        }

 

 

posted @ 2022-07-27 09:05  txwtech  阅读(1000)  评论(0编辑  收藏  举报