Articles in this section

How to set the date for the calendar to always show up as today in WinForms DateTimePicker (DateTimePickerAdv)?

Set current datetime

DateTimePickerAdv always displays the value which was set when the control was first added to the form. This is possible by setting the value of the datetimepicker to DateTime.Now in the form load event handler.

C#

private void Form1_Load(object sender, System.EventArgs e)
{
   this.dateTimePickerAdv1.Value =DateTime.Now ;
}

 

VB

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
   Me.dateTimePickerAdv1.Value = DateTime.Now
End Sub

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied