以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- [求助]日期问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=115710)
|
-- 作者:tter1526
-- 发布时间:2018/3/13 8:50:00
-- [求助]日期问题
我想把日期栏的输入方式变成,单击空格键输入今天日期,双击空格键变成明天。
怎么才能做到,我是新手麻烦写详细点。
谢谢
|
-- 作者:有点甜
-- 发布时间:2018/3/13 9:17:00
--
keydown事件
If e.keycode = 32 Then Dim cname As String = e.Table.cols(e.Table.colsel).name If cname = "第四列" Then static ptime As Date = Date.now Dim sp As TimeSpan = Date.now - ptime ptime = Date.now If sp.TotalMilliseconds <= 500 Then \'双击 e.Table.current(cname) = Date.today.AddDays(1) Else e.Table.current(cname) = Date.today End If e.cancel = True End If End If
|
-- 作者:有点甜
-- 发布时间:2018/3/13 9:19:00
--
或者keydownEdit事件
If e.keycode = 32 Then Dim cname As String = e.Table.cols(e.Table.colsel).name If cname = "第四列" Then static ptime As Date = Date.now Dim sp As TimeSpan = Date.now - ptime ptime = Date.now If sp.TotalMilliseconds <= 500 Then \'双击 e.Text = Date.today.AddDays(1) Else e.Text = Date.today End If e.cancel = True End If End If
|
-- 作者:tter1526
-- 发布时间:2018/3/13 9:23:00
--
谢谢老师!
|