Hi,
I have created
* 1 Datetimepicker (from date)
* 1 Comboxbox (How many days)
* 1 Textbox (Here it should display . Fromdate + How many days u select)
In the Combobox u select the from date in the combobox i have days 5,10,15,30 .
In the textbox i want to display the date.
So an example if i select 2014-02-22 in the DateTimePicker and in the Combox 5 Days i want it to display 2014-02-25 in the textbox.
Any Suggestions?
VulpesPosted Feb 22, 2014, 1:10 PM
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(comboBox1.SelectedIndex > -1)
{
DateTime dt = dateTimePicker1.Value;
int days = int.Parse(comboBox1.SelectedItem.ToString());
dt = dt.AddDays(days);
textBox1.Text = dt.ToString("yyyy-MM-dd");
}
}