Hi, How can I prevent a floatingform (which contains multiple controls docked in) from getting docked to the main form? The DragAllow event does not work in this case.
I am using Syncfusion version 4.2.
Thanks,
Ankur
>Hi Peter,
You can prevent docking to Main Form when the dock Tab or floating window's caption bar is double clicked . Please refer to the following code snippets which illustrates the same:
[ C# ]
//To prevent docking to Main Form when the floating window's caption bar is double clicked.
this.dockingManager1.EnableDoubleClickOnCaption = false;
// To prevent docking to Main Form when the dock Tab is double clicked.
private void dockingManager1_DragAllow(object sender, DragAllowEventArgs arg)
{
DockHost dhost = arg.Control.Parent as DockHost;
DockHostController dhc = dhost.InternalController as DockHostController;
if (dhc.ParentController is DockTabController)
{
DockTabControl docktab = (dhc.ParentController as DockTabController).TabControl;
foreach (DockTabPage tabpage in docktab.TabPages)
{
if (dockingManager1.IsTabbed(arg.Control))
{
if (!dhost.RectangleToScreen(dhost.TitleBar.CaptionRect).Contains(Cursor.Position) )
{
arg.Cancel = true;
}
}
}
}
}
Please have a look at this sample and let me know if this helps you.
http://websamples.syncfusion.com/samples/Tools.Windows/I34124/Main.htmThank you for using Syncfusion products.
Regards,
Rajesh C