---
title: "DateTimePicker Control in C#.Net"  
description: "A DateTimePicker control allows you to select a date and time, and to display that date and time in the specified format.  How to Use DateTimePicker C"  
author: "Anonymous User"  
published: 2011-01-24  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/399/datetimepicker-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# DateTimePicker Control in C#.Net

A DateTimePicker control allows you to select a date and time, and to display that date and time in the specified format.\

##### How to Use DateTimePicker Control

Drag and drop DateTimePicker control form toolbox on window Form.

![DateTimePicker Control in C#.Net](https://www.mindstick.com/mindstickarticle/aea83bb2-d985-47b0-994b-d94decb23e23/images/4ee552f6-1dae-4d3d-8f7a-ceb5b5df0a4e.png)

##### Code:

```
using System;using System.Text;using System.Windows.Forms;  namespace WindowsFormsApplication1{     public partial class Form7 : Form    {         public Form7()         {            InitializeComponent();         }         private void dateTimePicker1_ValueChanged(object sender, EventArgs e)         {            // show selected date             label1.Text = dateTimePicker1.Text;         }    }}
```

##### Run The Project

\

![DateTimePicker Control in C#.Net](https://www.mindstick.com/mindstickarticle/aea83bb2-d985-47b0-994b-d94decb23e23/images/6c1ae333-cd45-4afe-87da-77293298fefa.png)

When you click on the calendar icon in the control then calendar popup will show.

![DateTimePicker Control in C#.Net](https://www.mindstick.com/mindstickarticle/aea83bb2-d985-47b0-994b-d94decb23e23/images/856a64a5-f3a8-4a05-9f42-2f4ab218ec50.png)

When you select the date then ValueChanged event will fire and selected date will be show in Label.

![DateTimePicker Control in C#.Net](https://www.mindstick.com/mindstickarticle/aea83bb2-d985-47b0-994b-d94decb23e23/images/bac742d9-789e-4041-8039-ce0979ce2e60.png)

##### DateTimePicker Properties:

##### Format: we can set DateTimePicker Format in which Format it should show.

##### Example:

```
private void Form7_Load(object sender, EventArgs e){         //Display the date in Short Format         dateTimePicker1.Format = DateTimePickerFormat.Short;}
```

\

![DateTimePicker Control in C#.Net](https://www.mindstick.com/mindstickarticle/aea83bb2-d985-47b0-994b-d94decb23e23/images/e4fdf5ef-8ffa-4fbf-9175-dfd8795c0096.png)

\

Show checkbox:You can make a DateTimePicker control editable where you can change the value without using the popup Calendar. This can be done by setting ShowCheckBox property to true.

##### Example:

```
private void Form7_Load(object sender, EventArgs e){         // Makes DateTimePicker editable         dateTimePicker1.ShowCheckBox = true;}
```

\

![DateTimePicker Control in C#.Net](https://www.mindstick.com/mindstickarticle/aea83bb2-d985-47b0-994b-d94decb23e23/images/0de6f3d5-8d20-432c-b341-3479fb93afe4.png)

Checkbox will show in DateTimePicker. You can edit the value in DateTimePicker and changed value will show in Label.

**ShowUpDown:** We can also use an up-down control to set the date and time.

##### Example:

```
private void Form7_Load(object sender, EventArgs e){            //UpDown control will show in DateTimePicker             dateTimePicker1.ShowUpDown = true;}
```

\

![DateTimePicker Control in C#.Net](https://www.mindstick.com/mindstickarticle/aea83bb2-d985-47b0-994b-d94decb23e23/images/b39b0d18-a6cd-401c-8af2-80e7c5824d09.png)

##### UpDown Control is display in DateTimePicker.we can change date through Updown button.

---

Original Source: https://www.mindstick.com/articles/399/datetimepicker-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
