Disable Close Button

Topics: User Forum
Aug 24, 2006 at 7:54 AM
Have had a look at your control and it looks like I could use it in my application, can the close button be disabled as i don't want teh end user to be able to cvlose any of the tab windows.

Is this possible???
Aug 25, 2006 at 11:13 PM
You can trap the WindowClosing event of the WindowManager component and cancel the action.

I will add a ShowCloseButton property to complement the ShowLayoutButtons property. However, this doesn't mean the user can't try to close the window via another mechanism (such as a right-click on the window's tab)... which is why the best way is to handle the WindowClosing event of WindowManager component.
Aug 25, 2006 at 11:14 PM
This discussion has been copied to Work Item 2604. You may wish to continue further discussion there.
Sep 6, 2006 at 3:01 AM
In addition to being able to hide the close button... as of change set 5148 (post RC2) a window's CloseReason is indicated in WindowManager's WindowClosing/WindowClosed event.

You can now do this.

Private Sub WindowManager1_WindowClosing(ByVal sender As Object, ByVal e As MDIWindowManager.WrappedWindowClosingEventArgs) Handles WindowManager1.WindowClosing

If e.CloseReason = CloseReason.UserClosing Then
e.Cancel = True
End If

End Sub