Is it possible to do this?I am trying to have three separate drop down boxes with one for the hours(hh), one for the minutes(mm) and the last for seconds(ss) and parsinfg them and making it just one time.
Here is my code that I used for a text box;
TimeSpan ts1 = TimeSpan.Parse(txtStart.Text);
TimeSpan ts2 = TimeSpan.Parse(txtEnd.Text);
txtDisplay.Text = (ts2 - ts1).ToString();
I used this code for two textboxes and figured that it would be harder for the user to enter time so I tried putting a dropdownbox instead to ease everything for the user and it keeps giving me an error.
Here is my code;
TimeSpan ts2 = TimeSpan.Parse(txtEnd.Text);
TimeSpan hh = TimeSpan.Parse(drpdwn1.SelectedValue);
TimeSpan mm = TimeSpan.Parse(drpdwn2.SelectedValue);
TimeSpan ss = TimeSpan.Parse(drpdwn3.SelectedValue);
txtDisplay.Text = (ts2 - (hh:mm:ss)).ToString();
I'm only using ts2 for an example here, later on if this works I will add three more drop down boxes to ease the entering of a start and end time for a user. Can someone help me find the right code?