Meyka Jograt Meyka Jograt - 4 months ago 8
Vb.net Question

Set DateTimePicker to 12/31/[THIS YEAR]

I want to display in my DatetimePicker always the End of the year.

For example this year 12/31/2016.

Then if its 01/01/2017 today then the DateTimePicker will display 2017 End of the Year which its 12/31/2017.

How can I Set/Code this to DateTimePicker?

Answer

This will do it for the current year:

DateTimePicker1.Value = New DateTime(DateTime.Now.Year, 12, 31)
Comments