I'm using a NumericUpDown control and I have a DateTimePicker control that holds a date
what I need done is when the NumericUpDown control's value changes I need to show a date in a label that is # days higher than the date in the DateTimePicker
I'm using the NumericUpDown's ValueChanged event which does fire everytime the value changes, except this only works the first time the value changes, the code executes but it does not produce a new date in the label after the first value change.
Here's the code I have so far:
what I need done is when the NumericUpDown control's value changes I need to show a date in a label that is # days higher than the date in the DateTimePicker
I'm using the NumericUpDown's ValueChanged event which does fire everytime the value changes, except this only works the first time the value changes, the code executes but it does not produce a new date in the label after the first value change.
Here's the code I have so far:
VB.NET:
'dtpDateOut is a DateTimePicker
'nudDaysBack is a NumericUpDown
'lblNewDate is a Label
Private Sub nudDaysBack_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudDaysBack.ValueChanged
Dim newDT As DateTime = dtpDateOut.Value
newDT.AddDays(nudDaysBack.Value)
lblNewDate.Text = newDT.ToShortDateString
End Sub