Help with end of month
Hi,
When the user chooses the end of month as date from DateTimePicker,
The months should be incremented correctely.
For example, if one has date 31/12/2012, he should receive:
31/01/2012, 29/02/2012, 31/03/2012, and so on.
But with the code below, the date doesnât move from the day 29:
31/01/2012, 29/02/2012/, 29/03/2012, 29/04/2012,...
Any help would be appreciated with great many thanks.
This is the code:
Dim dtN As Date = DateTimePicker.Value.ToShortDateString
Dim i as integer
For i = 1 To Periods
dtN = dtN.AddMonths(1)
dgvAmortis.Rows.Add()
dgvAmortis.Item("datecol", i - 1).Value = Format(dtN, "dd/MM/yyyy").ToString
|