Foxtable(狐表)用户栏目专家坐堂 → beforecolse中的cancel = true 不起作用?


  共有2042人关注过本帖平板打印复制链接

主题:beforecolse中的cancel = true 不起作用?

帅哥哟,离线,有人找我吗?
tld
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:735 积分:7646 威望:0 精华:0 注册:2017/2/3 10:29:00
beforecolse中的cancel = true 不起作用?  发帖心情 Post By:2020/11/10 5:35:00 [只看该作者]

老师,我在窗口的beforeclose事件中有如下代码:
For Each dr As DataRow In DataTables(e.Form.name & "_table1").dataRows
    If dr.RowState <> DataRowstate.unchanged Then
        Dim Result As DialogResult
        Result = MessageBox.Show("上表中有未保存的行 , 请确认是否需要处理 ?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If Result = DialogResult.Yes Then
            e.Cancel = True
            Return
        End If
    End If
Next

执行上述代码,点击 yes 后,窗口依然关闭,不知道什么原因?请指点。谢谢!

 回到顶部