以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]BeforClose事件代码想写成函数,e.cancel如何处理?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=41445)

--  作者:loongtai
--  发布时间:2013/10/19 12:51:00
--  [求助]BeforClose事件代码想写成函数,e.cancel如何处理?
窗口的beforeClose事件写成内部函数的形式,但是e.Cancel 语句不知如何处理?
dim fnm as string=Args(0)
Dim tr As WinForm.TreeView = Forms(fnm).Controls("TreeView1")
For Each nd As winform.treenode In tr.allnodes
    nd.Forecolor=Color.black
Next
    Dim result As Dialogresult
    result=messagebox.show("是否保存此次所做的修改?","是否保存",MessageBoxbuttons.YesNoCancel,messageboxicon.question)
    If result=DialogResult.yes Then
        保存.PerformClick()  
    Else
e.cancel=True
    End If


--  作者:blackzhu
--  发布时间:2013/10/19 13:21:00
--  
用返回.
--  作者:hanxuntx
--  发布时间:2013/10/19 13:28:00
--  
e.cancel = Functions.Execute("你的函数返回值")