以文本方式查看主题

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

--  作者:133198609
--  发布时间:2018/11/15 10:48:00
--  页面关闭问题
Public Sub _TabPageClosing(sender As Object, e As C1.Win.C1Command.TabPageCancelEventArgs)
\'页面关闭按钮点击事件
MessageBox.Show(e.TabPage.Name)
If e.TabPage.Name = "主页" Then
    MessageBox.Show("主页不能关闭!")
    e.Cancel = True
Else
MessageBox.Show(e.TabPage.Name)
    forms(e.tabpage.name).close
End If
End Sub

全局变量里面用的是这个,但是在关闭页面的时候,正常关闭,但是没有提示。这个messagebos.show没有触发。

--  作者:有点甜
--  发布时间:2018/11/15 10:55:00
--  
你绑定事件了没有?
 
Dim t As C1Command.C1DockingTab = Forms("主窗口").Controls("TabControl1").BaseControl
t.CanCloseTabs = True
t.CloseBox = 2
AddHandler t.TabPageClosing, AddressOf _TabPageClosing

--  作者:133198609
--  发布时间:2018/11/15 11:11:00
--  
AddHandler t.TabPageClosing, AddressOf _TabPageClosing

哎呀,把这句落下了。感谢感谢!