给并列窗口加上关闭按钮,按照论坛上面,新建一个项目的时候可以实现,但是在原来的项目上却没反应,请问可能的原因是什么,我用message.show验证了AfterOpenProject中的代码有运行。接下来我应该如何排查或者试验?
在全局代码中写入:
Public Sub
_TabPageClosing(sender As Object, e As C1.Win.C1Command.TabPageCancelEventArgs)
'页面关闭按钮点击事件
Dim name = e.TabPage.Text
If name = "主页" Then
e.Cancel = True
Else
If Forms.contains(name) Then
e.Cancel = True
Forms(name).Close
If sender.tabpages.Contains(e.tabpage)
sender.tabpages.remove(e.tabpage)
End If
End If
End If
End Sub
在AfterOpenProject写入:
Dim MainTab As
C1Command.C1DockingTab = BaseMainform.Controls("MainPages")
Dim FormTab As
C1Command.C1DockingTab = MainTab.TabPages(0).controls(0)
FormTab.CanCloseTabs
= True
FormTab.CloseBox =
1
Formtab.CanAutoHide
= True
AddHandler
Formtab.TabPageClosing, AddressOf _TabPageClosing