0

Please help me. I know this kind a simple problem. My problem is when i select the end day of the month it gives me a negative days
in txtdays.
This is my code to txtdays

txtDays.Text = dtpEnd.Value.Day - dtpStart.Value.Day

This is my code to add date to datetimepicker

Private Sub dtpStart_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtpStart.ValueChanged

        dtpEnd.Value = dtpStart.Value.AddDays(2.0)

    End Sub

Please help me
Thanks in advance!!

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by comsci2
0

>My problem is when i select the end day of the month it gives me a negative days in txtdays.

Dim tm as TimeSpan
tm=  dtpEnd.Value - dtpStart.Value
txtDays.Text= tm.Days.ToString()
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.