Dim hour1 As Integer = cmb_h1.Text Dim hour2 As Integer = cmb_h2.Text Dim minute1 As Integer = cmb_m1.Text Dim minute2 As Integer = cmb_m2.Text '(19 - 9) + (0 - 30) ÷ 60 = 9.5 TextBox1.Text = (hour2 - hour1) + (minute2 - minute1) / 60
Dim time1 As Date = TimeSerial(cmb_h1.Text, cmb_m1.Text, 0) Dim time2 As Date = TimeSerial(cmb_h2.Text, cmb_m2.Text, 0) TextBox1.Text = time2.Subtract(time1).TotalHours