In this article I will explain with an example, how to use Calendar in Windows Forms (WinForms) Application using C# and VB.Net.
 
 
Form Design
The following Form consists of a DateTimePicker control and a Button. The Button has been assigned a Click event handler.
Using Calendar in Windows Forms with C# and VB.Net
 
 
Fetching the value of the Selected Date
When the Submit Button is clicked, following event handler is executed.
Inside this event handler, the value of the Selected Date is fetched and displayed using MessageBox.
C#
private void btnSubmit_Click(object sender, EventArgs e)
{
    DateTime dt = Convert.ToDateTime(dateTimePicker1.Value);
    MessageBox.Show("Selected Date: " + dt.ToString());
}
 
VB.Net
Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
    Dim dt As DateTime = Convert.ToDateTime(dateTimePicker1.Value)
    MessageBox.Show("Selected Date: " & dt.ToString())
End Sub
 
 
Screenshot
Using Calendar in Windows Forms with C# and VB.Net
 
 
Downloads