Articles in this section
Category / Section

How to remove the close button on particular docked window?

1 min read

 

User can hide the close button for the specific dock window. It can be achieved by adding only the required custom buttons to custom caption buttons collection to the control using the SetCustomCaptionButtons function of DockingManager. Here we can add only the Menu and Pin caption buttons in second dock window. The following code demonstrates the same. 

 

C#

//Initialize CaptionButtonsCollection
 
private CaptionButtonsCollection captionButtons = new CaptionButtonsCollection();
 
//Initialize required Caption Buttons
 
Syncfusion.Windows.Forms.Tools.CaptionButton menu = new Syncfusion.Windows.Forms.Tools.CaptionButton(CaptionButtonType.Menu);
 
Syncfusion.Windows.Forms.Tools.CaptionButton pin = new Syncfusion.Windows.Forms.Tools.CaptionButton(CaptionButtonType.Pin);
 
//Add required caption buttons into CaptionButtons collection
 
captionButtons.Add(pin);
 
captionButtons.Add(menu);
 
//Add CaptionButtons collection into required panel/dock window
 
this.dockingManager1.SetCustomCaptionButtons(this.panel2, captionButtons);

 

VB

‘Initialize CaptionButtonsCollection
 
Private captionButtons As New CaptionButtonsCollection()
 
‘Initialize required Caption Buttons
 
Dim menu As New Syncfusion.Windows.Forms.Tools.CaptionButton(CaptionButtonType.Menu) 
 
Dim pin As New Syncfusion.Windows.Forms.Tools.CaptionButton(CaptionButtonType.Pin) 
 
‘Add required caption buttons into CaptionButtons collection
 
captionButtons.Add(pin) 
 
captionButtons.Add(menu) 
 
//Add CaptionButtons collection into required panel/dock window
Me.dockingManager1.SetCustomCaptionButtons(Me.panel2, captionButtons) 

 

 

Screenshot

 

Showing different docking form

 

Samples:

 

C#:  DockingManagerSample

 

VB: DockingManagerSample

 

 

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