date/time picker

desperado

Well-known member
Joined
Oct 7, 2006
Messages
68
Programming Experience
Beginner
Hi I need some help please.. I want to display the date chosen from a date/time picker in a textbox, and from that textbox to display another day(exactly) 7 days later in another textbox.

Any help or suggestion please?
 
The Date value of DateTimePicker is its Value property. Fetch this Date, use the AddDays method to add your 7.
 
You don't know how to use a property value? I was thinking like:
VB.NET:
Dim d As Date = dtp.Value
Textbox1.Text = d.ToShortDateString()
Textbox2.Text = d.AddDays(7).ToShortDateString()
maybe it would be better to access the Value property directly:
VB.NET:
Textbox1.Text = dtp.Value.ToShortDateString()
Textbox2.Text = dtp.Value.AddDays(7).ToShortDateString()
 
Back
Top