以文本方式查看主题

-  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=145298)

--  作者:hwlzgt
--  发布时间:2020/1/15 11:33:00
--  双击日期列 日期(连续)增加 问题
请教: 在表DoubleClick 双击单元格事件中 代码如下:
Select Case e.Col.name
    Case "xmjq" \'项目交期
        If e.Table.AllowEdit = True Then  
            Dim dt As Date = e.Row("xmjq")
                If dt = Nothing Then 
                   e.Row("xmjq")= Date.Today.AddDays(3)
                Else
                   e.Row("xmjq")= dt.AddDays(1)
                End If              
        End If
End Select

事件只执行了一次,不移动行或是单元格第二次双击就无效了。如何实行连续双击,日期不断增加呢?

--  作者:有点蓝
--  发布时间:2020/1/15 12:03:00
--  
Select Case e.Col.name
    Case "xmjq" \'项目交期
        If e.Table.AllowEdit = True Then  
            Dim dt As Date = e.Row("xmjq")
                If dt = Nothing Then 
                   e.Row("xmjq")= Date.Today.AddDays(3)
                Else
                   e.Row("xmjq")= dt.AddDays(1)
                End If   
            e.Cancel = True           
        End If
End Select