Hi Shane,
Thank you for your interest in Syncfusion products.
Disabling CaptionBar buttons.You can disable the functionalities of CaptionBar buttons on the docking control by handling click event of CaptionBar button and setting e.Cancel to true. Here is a code snippet.
[C#]
this.dockingManager1.CaptionButtons[0].Click += new CancelEventHandler(button1_Click);
this.dockingManager1.CaptionButtons[1].Click += new CancelEventHandler(button1_Click);
this.dockingManager1.CaptionButtons[2].Click += new CancelEventHandler(button1_Click);
this.dockingManager1.CaptionButtons[3].Click += new CancelEventHandler(button1_Click);
void button1_Click(object sender, CancelEventArgs e)
{
e.Cancel = true;
}
Sample referencePlease refer the below sample that illustrates the same.
http://websamples.syncfusion.com/samples/Tools.Windows/F71520/main.htm Disabling highlight when mouse hover on CaptionBar buttons.For this , you need to derive the DockingManager->DockHost->CaptionPainter and override the CaptionHitTest method in the CaptionPainter class and change the CaptionButtonState to Normal when MouseAction is MouseMove.
Please refer to the following code snippet.
[C#]
public class CustomDockingManager : DockingManager
{
protected override DockHost CreateDockHost(Control ctrl){
return new CustomDockHost(this, ctrl); }
}
// To plugin CustomCaptionPainter
public class CustomDockHost : DockHost
{
public CustomDockHost(DockingManager manager, Control ctrl):base(manager, ctrl)
{ }
protected override CaptionPainter CreateCaptionPainter()
{
return new CustomCaptionPainter(this.dcInternal);
}
}
public class CustomCaptionPainter : CaptionPainter
{
public CustomCaptionPainter(DockHostController dcb):base(dcb)
{ }
// Overriding these let you customing painting caption.
// Refer to ..Tools\src\Docking Manager\FrameworkComponents\DockingWindows\CaptionPainter.cs for imp. details.
protected override void DrawHoverBorder(Graphics gph, Rectangle rcbtn)
{
// base.DrawHoverBorder(gph, rcbtn);
//Implement your own code here.
}
protected override void DrawPressedBorder(Graphics gph, Rectangle rcbtn)
{
//base.DrawPressedBorder(gph, rcbtn);
//Implement your own code here.
}
public override void PaintCaption(Graphics gph)
{
//base.PaintCaption(gph);
//Implement your own code here.
}
public override Syncfusion.Windows.Forms.Tools.CaptionPainter.CaptionHitTest HitTest(MouseAction action, Point pt)
{
if ( action == MouseAction.MouseMove )
{
stateAppearance = CaptionButtonState.Normal;
}
return base.HitTest (action, pt);
}
}
Please let me know if this helps you.
Regards,
Jaya