在一个标签中区分当前值和上一个值 [英] Make difference of the current value and the previous value in one label

查看:84
本文介绍了在一个标签中区分当前值和上一个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个标签,标签中的值一直在变化.现在,我想先在当前值和上一个值之间进行区别.然后,将其除以时间差.
这个怎么做??请帮忙!

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!!

推荐答案

将当前"和先前"值存储在适当类型的变量中(您未指定任何值). ..)和与众不同.
关于除以它们的时差(假设您的数据类型是可分割的:rolleyes:),则必须:
  • 将当前"和上一个"时间存储在DateTime对象中(使用Now属性)
  • 将差异存储在TimeSpan对象中.
  • 使用TimeSpan对象的适当属性(例如TotalSeconds)作为除数.
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.




只要文本值发生更改,您就可以在标签的tag属性中保留先前的值.
Hi,

You can keep previous value in tag property of the label whenever it text value changed.


您可以在会话中获取您的值并执行任务
you can take your value in session and perform your task


这篇关于在一个标签中区分当前值和上一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆