Question Date Problem...

zahir

Member
Joined
Apr 9, 2009
Messages
9
Programming Experience
1-3
Hello everyone!

I have one simple question but can't even solve it :p:p:p

This is the algorithm...

I have one textbox and one DateTimePicker,
In the textbox i have display a value e.g the value is =7
if dateTimePicker(currentDate) go to next means date(TomorrowDate) so the value become =0...

like this
CurrentDate + 1days = NextDate
so value = 0

Please help me...
 

Robert_Zenz

Well-known member
Joined
Jun 3, 2008
Messages
503
Location
Vienna, Austria
Programming Experience
3-5
Oh god that hurts...please turn Option Strict On!

VB.NET:
Label1.Text = Date.Now.AddDays(Convert.ToInt32(NumericUpDown1.Value)).ToString()

' splitted down

Dim daysToAdd As Integer = Convert.ToInt32(NumericUpDown1.Value)
Dim tomorrow As Date = Date.Now.AddDays(daysToAdd)

Labe1.Text = tomorrow.ToString()
 
Top Bottom