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

Removing CaptionButton

Hi,

I'd like to remove caption buttons programmatically from a dock control but without effecting the default caption button collection for the DockingManager. How can I do this?


2 Replies

PK Pavan Kumar K Syncfusion Team December 18, 2007 01:44 PM UTC

Hi Stephen,

Thanks for your interest in Syncfusion products.

You can remove the Custom Caption Button using the Remove() method of CaptionButtonsCollection.

Here is the sample code snippet.



private void buttonAdv1_Click(object sender, EventArgs e)
{
try
{
DialogResult result = MessageBox.Show("Do you want to Remove Custom

Button??", "Remove...", MessageBoxButtons.OKCancel);

if (result == DialogResult.OK)
{
//In Remove method Pass the argument as name of the custom button

cbGroupBar1.Remove(previous);


MessageBox.Show("succesfully Removed", "Removed..");
}
else if (result == DialogResult.Cancel)
{
MessageBox.Show("Removal Process Cancelled..");
}
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}


}




Please refer the sample and let me know if this helps.

rel='nofollow' href="
http://websamples.syncfusion.com/samples/Tools.Windows//I70547/main.htm">http://websa

mples.syncfusion.com/samples/Tools.Windows//I70547/main.htm


Regards,
Pavan. K




PK Pavan Kumar K Syncfusion Team December 18, 2007 01:49 PM UTC

Hi Stephen,

Sorry for the broken link.


Please refer the sample and let me know if this helps.
http:/websamples.syncfusion.com/samples/Tools.Windows/I70547/main.htm


Regards,
Pavan. K


Loader.
Live Chat Icon For mobile
Up arrow icon