Click here to Skip to main content
15,745,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one label and the value in it, keeps changing. Now I want to make a difference between the current value and the previous value first. Then after that, divide it by their time difference.
How to do this?? Please help!!
Updated 22-Dec-10 21:44pm
Scubapro 23-Dec-10 3:44am    
Edited for readability.

Store the 'current' and 'previous' values in variables of the appropriate type (you didn't indicate any...) and the make the difference.
As about dividing by their time difference (provided your data type is divisible :rolleyes: ), you have to:
  • Store 'current' and 'previous' times in DateTime objects (use the Now property)
  • Store the difference in a TimeSpan object.
  • Use the appropriate property of the TimeSpan object (for instance TotalSeconds) as divisor.
Share this answer

You can keep previous value in tag property of the label whenever it text value changed.
Share this answer
you can take your value in session and perform your task
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900