Question How can I use timer in a subitem(column) of listview for my time consumed column?

The_Kid

Member
Joined
Sep 17, 2012
Messages
14
Programming Experience
3-5
I have this column named Time Started ( this data comes from different client) and the other is Time Consumed column. I am the server and I want to animate all the time in Time consumed column by subtracting current time i have. How can I do that? moving timer for subitem(3). Is it much better that it will be based on my pc or always fetch the time consumed/sec on clients computer to the server?
 
Hi The_Kid,

Had a look at this now and the reason that the timer is not firing is that you have tested the wrong variable to activate the timer. You currently have:-

VB.NET:
If onlineCount > 0 Then
   MsgBox("WORK NOW!!")
   consumedTime.Enabled = True
   MsgBox("Jump")
 ElseIf onlineCount <= 0 Then
   consumedTime.Enabled = False
 End If
but this should say:-

VB.NET:
If connectedCount > 0 Then
   MsgBox("WORK NOW!!")
   consumedTime.Enabled = True
   MsgBox("Jump")
 ElseIf connectedCount <= 0 Then
   consumedTime.Enabled = False
 End If
This is because when you are adding a connection you are setting the connectedCount variable and not the onlineCount variable.

Once this is done you are then going to get your Invalid Date errors again because you have set the following in the ipDetail array:-

ipDetail(2) = "1"

This needs to be a valid date time in your own format otherwise the timer calculation will not work again. i.e. ipDetail(2) = "09/23/12 04:41:00".

You may get other knock-on affects but let's deal with them one at a time.

Cheers,

Ian
 
Back
Top