Dim today As System.DateTime Dim future As System.DateTime today = System.DateTime.Now future = today.AddDays(NumberOfDays) MessageBox.Show(future)
TextBox DateBox; TextBox DaysBox; DateTime AddDays(string DateString, string DaysString) { DateTime TheDate = DateTime.Parse(DateString); int Days = int.Parse(DaysString); return TheDate.AddDays((double)Days); } //Event method called by both DateBox text changed event and DaysBox text changed event. void TextChanged(object sender, EventArgs e) { DateTime Result = AddDays(DateBox.Text, DaysBox.Text); MessageBox.Show(Result.ToString()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)