您当前的位置: 首页 >  c#

txwtech

暂无认证

  • 2浏览

    0关注

    813博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

txwtech 发布时间:2022-07-27 08:57:33 ,浏览量:2

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

dateTimePicker_start_date是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();
            
        }

 

关注
打赏
1665060526
查看更多评论
立即登录/注册

微信扫码登录

0.0372s