Articles in this section
Category / Section

How to remove the close button in DockingManager?

2 mins read

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

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

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied