)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to remove the close button in DockingManager?

Platform: WinForms |
Control: DockingManager |
Published Date: February 24, 2015 |
Last Revised Date: May 23, 2019

In DockingManager, you can customize the Close button appearance using the following options.

  1. By using “CloseEnabled” property.
  2. By removing Close button from CaptionButtonCollection

The following code example demonstrates the same.

C#

//Option 1
private void SetCaptionBtnOptions()
{
//Hide the CloseButton for all the Controls that are DockEnabled.
for (int i = 0; i < this._dockingMgr.CaptionButtons.Count; i++)
{
if (this._dockingMgr.CaptionButtons[i].Name == "CloseButton")
{
this._dockingMgr.CaptionButtons.RemoveAt(i);
}
}
}
//Option 2
//Hide the CloseButton for all the Controls that are DockEnabled
this.dockingManager1.CloseEnabled = false;

VB

'Option 1
Private Sub SetCaptionBtnOptions()
'Hide the CloseButton for all the Controls that are DockEnabled.
Dim i As Integer = 0
Do While i < Me.dockingManager1.CaptionButtons.Count
If Me.dockingManager1.CaptionButtons(i).Name = "CloseButton" Then
Me.dockingManager1.CaptionButtons.RemoveAt(i)
End If
i += 1
Loop
End Sub
'Option 2
'Hide the CloseButton for all the Controls that are DockEnabled.
this.dockingManager1.CloseEnabled = false;

The following screenshots illustrates the output.

Showing after remove  close button in floating control

Figure 1: Close Button removed in Floating controls

Showing after remove the close button in docked controls

Figure 2: Close Button removed in docked controls

Sample

http://www.syncfusion.com/downloads/support/directtrac/general/HideCloseButton-368947012.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon