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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to remove the close button on particular docked window?


 

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

 

 

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.

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