本文介绍了在哪里放置DateDiff函数以对所有记录生效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CodeProject的成员您好,
我有一个项目,以及一个包含员工信息(姓名,城镇,生日,HireDate等)的数据库.我添加了自定义TextBox(运行中),并在该TextBox上添加了代码:
TexBox1.text = DateDiff("d", HireDateDateTimePicker.value, Now)
这是根据HireDate和Now计算工人在公司工作的天数.
我已将代码放在事件TextBox1_TextChanged上.但是,这意味着我需要在TextBox1中移动光标以应用更改.
我也尝试过使用MouseMove.它可以工作,但是如果我有一个庞大的数据库,那么应用程序将一直在读取MouseMove上的脚本,这样会使整个程序变慢.
需要别人给小费,例子等等...
预先感谢您对任何人的帮助.

Hello members of CodeProject,
I have a project, a database with employee information (name, town, birthday, HireDate, etc). I have add custom TextBox (on fly), and on that TextBox a code:
TexBox1.text = DateDiff("d", HireDateDateTimePicker.value, Now)
which is calculating how many days worker is working in company from HireDate, and Now.
I have put code on event TextBox1_TextChanged. But, this means that I need to move cursor in TextBox1 to apply changes.
I have also try with MouseMove. It works, but if I would have a huge database, then application will all the time reading script on MouseMove, and by that will slow down entire program.
Need someone to give a tip, example, etc...
Thank you in advance for help to anyone.

推荐答案




这篇关于在哪里放置DateDiff函数以对所有记录生效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 06:22