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. Image for the cookie policy date
close icon

Custom button events

How do you enable click event on custom button in docking manager that has been added through designer?

2 Replies

SK Senthil Kumaran Rajan Syncfusion Team April 24, 2017 06:23 AM UTC

Hi Mariusz, 
 
Thanks for contacting Syncfusion Support. 
 
We can handle the click event of the custom button in DockingManager, by finding the index of the custom button in the CaptionButtons collection and hook the click event of that caption button. This event cannot be directly handled from the designer. Please make use of the below code example. 
 
Code Example[C#]: 
 
this.dockingManager1.CaptionButtons[5].Click += new CancelEventHandler(Form1_Click); 
 
  void Form1_Click(object sender, CancelEventArgs e) 
        { 
            MessageBox.Show("Custom Caption Button Clicked"); 
        } 
 
 
We have prepared the sample for your reference and this can be downloaded from the below location. 
 
Sample : 
 
Also, refer the below screenshot for further reference. 
 
 
 
Could you please check with the above sample and let us know the provided solution is helpful? If not, please share us some additional details about this requirement. It will help to analyze and provide you a prompt solution at the earliest.   
 
Regards, 
Senthil


SK Senthil Kumaran Rajan Syncfusion Team April 24, 2017 06:28 AM UTC

Hi Mariusz, 
 
Please ignore our previous update 
 
We can handle the click event of the custom button in DockingManager, by finding the index of the custom button in the CaptionButtons collection and hook the click event of that caption button. This event cannot be directly handled from the designer. Please make use of the below code example. 
 
Code Example[C#]: 
 
this.dockingManager1.CaptionButtons[5].Click += new CancelEventHandler(Form1_Click); 
 
  void Form1_Click(object sender, CancelEventArgs e) 
        { 
            MessageBox.Show("Custom Caption Button Clicked"); 
        } 
 
 
We have prepared the sample for your reference and this can be downloaded from the below location. 
 
 
Also, refer the below screenshot for further reference. 
 
 
 
Could you please check with the above sample and let us know the provided solution is helpful? If not, please share us some additional details about this requirement. It will help to analyze and provide you a prompt solution at the earliest.   
 
Regards, 
Senthil

Loader.
Live Chat Icon For mobile
Up arrow icon