For i = 0 To ComboBox3.Items.Count -1 //the -1 is for next loop by all combobox stored items (in this case remaining time) Dim d As DateTime = DateTime.Now Dim parsedate As String = ComboBox2.SelectedItem.ToString //this is where old datetime.now is stored Dim d2 As DateTime = DateTime.ParseExact(parsedate.ToString, "dd/MM/yyyy hh:mm:ss", System.Globalization.CultureInfo.CurrentCulture) //now this string it's giving me an error to datatime not valid Dim dysdiff As Integer = (d - d2).Days //this one is to make the subtraction between old timestamp and new, the old one are stored in combobox2, both will have always same number of items ComboBox3.Items(i) = (365 - dysdiff).ToString + " Days" //this one is for substitute the old value of remaining time to new one, always in days format ComboBox3.SelectedIndex = i Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)