以文本方式查看主题

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

--  作者:ycs5801
--  发布时间:2021/4/10 23:27:00
--  窗口关闭项目问题
窗口beforeclose时间中代码:

If User.Type <> UserTypeEnum.Developer
    Dim Result As DialogResult
    Result = MessageBox.Show("确定关闭软件?", "提示", MessageBoxButtons.OKCancel,MessageBoxIcon.Question)
    If Result = DialogResult.OK Then
        Syscmd.Project.Exit(True)
    Else
        e.Cancel = True
    End If
End If

点确定后,持续跳出确认框,关闭不了项目,哪里错了?

--  作者:有点蓝
--  发布时间:2021/4/11 20:43:00
--  
窗口beforeclose事件:

If User.Type <> UserTypeEnum.Developer
    Dim Result As DialogResult
    Result = MessageBox.Show("确定关闭软件?", "提示", MessageBoxButtons.OKCancel,MessageBoxIcon.Question)
    If Result = DialogResult.Cancel Then
        e.Cancel = True
    End If
End If

afterclose事件
Syscmd.Project.Exit(True)

--  作者:ycs5801
--  发布时间:2021/4/12 13:19:00
--  
这样,如果是开发者关闭窗口,也会将整个项目关闭了。
--  作者:ycs5801
--  发布时间:2021/4/12 13:50:00
--  
已解决,谢谢。