以文本方式查看主题

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

--  作者:xubing051018
--  发布时间:2024/4/3 15:52:00
--  [求助]代码重复执行
窗口里有个CheckBox控件,绑定了表A里的一个逻辑列B,
表A的 DataColChanging事件里写的代码

Select Case e.DataCol.Name
    Case "B"
        If e.NewValue = True Then
            MessageBox.Show("弹窗")
        End If 
End Select

现在发现在窗口里勾选上CheckBox, 会出来两次弹窗,这是怎么回事? 
在表里勾选上B列,是正常的一次弹窗

--  作者:cd_tdh
--  发布时间:2024/4/3 15:55:00
--  
  If e.NewValue = True Then
            MessageBox.Show("弹窗")
e.Cancel = True \'取消编辑

--  作者:xubing051018
--  发布时间:2024/4/3 16:14:00
--  
没有用,依然弹窗两次
--  作者:有点蓝
--  发布时间:2024/4/3 16:15:00
--  
算是个bug,解决方法是放到DataColChanged事件,或者不要使用MessageBox.Show