Hi,
I'm working on an assignment that requires I loop through a list box with time strings (ex: 1:38 PM, 1:40 PM etc.)
I need a time to compare the current time and the time in the list box and if the current time is greater I have a message box appearing.
I can't get the message box to appear after the timer increments (my timer is anabled at 60000 interval).
--This is the code structure I have so far but it's not working.
I need the If statement to compare the current time and the times in the list box IN **Short Time format**. Any suggestions?
For i = lstTime.Items.C ount - 1 To 0 Step 1
If CDate(Now.Date. ToShortTimeStri ng) > Convert.ToDateT ime(lstTime.Ite ms(i)) Then
MessageBox.Show ("Time has elapsed")
End If
Next
I'm working on an assignment that requires I loop through a list box with time strings (ex: 1:38 PM, 1:40 PM etc.)
I need a time to compare the current time and the time in the list box and if the current time is greater I have a message box appearing.
I can't get the message box to appear after the timer increments (my timer is anabled at 60000 interval).
--This is the code structure I have so far but it's not working.
I need the If statement to compare the current time and the times in the list box IN **Short Time format**. Any suggestions?
For i = lstTime.Items.C ount - 1 To 0 Step 1
If CDate(Now.Date. ToShortTimeStri ng) > Convert.ToDateT ime(lstTime.Ite ms(i)) Then
MessageBox.Show ("Time has elapsed")
End If
Next
Comment