Private timeLeft As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load BindQuestion(1) TimerInfo.Totaltime = DateTime.Now.AddMinutes(120).ToString() Timer1.Start() 'Bind 1st question by default End Sub
Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If 0 > DateTime.Compare(DateTime.Now, DateTime.Parse(TimerInfo.Totaltime)) Then timeLabel.Text = "Number of Minutes Left: " & Convert.ToString(Convert.ToDateTime(TimerInfo.Totaltime).Subtract(DateTime.Now).TotalMinutes) End If
Dim myTimeSpan as TimeSpan myTimeSpan = TimerInfo.TotalTime - DateTime.Now msgbox(myTimeSpan.TotalMinutes())
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)