以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  如何设置不重复提示  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=128124)

--  作者:xlrboy
--  发布时间:2018/11/29 13:20:00
--  如何设置不重复提示
我在删除行设置了代码禁止删除并提示,如果一次选择了很多行会一直提示,如何设置只提示一次。
If User.Name = "游客" Then
        e.Cancel = True
    MessageBox.Show("您是游客,只能看哦.", "提示")
End If

--  作者:有点甜
--  发布时间:2018/11/29 14:59:00
--  

代码改成

 

static ptime As Date = Nothing
static presult As Boolean = False
Dim sp As TimeSpan = Date.now - ptime
ptime = Date.now
If sp.TotalMilliseconds < 2000  Then \'间隔2秒点击才有效
    e.cancel = presult
    Return
End If

If User.Name = "游客" Then
    e.Cancel = True
    presult = True
    MessageBox.Show("您是游客,只能看哦.", "提示")
Else
    presult = False
End If