Search code examples
vb.netdatetimepickervb.net-2010

how to detect number of days of the succeeding month in vb.net?


I have two datetimepickers and one textbox. One is for effectivitydate and the other one is for expirationdate. Textbox is for the result number of days of two datetimepickers. If the textbox is 5 days beyond the succeeding month then the messagebox will popup with the message "The document was submitted beyond 5 days of the succeeding month!"


Solution

  • You could use:

    Dim maxDate = New Date(Now.Year, Now.Month + 1, 5)