Hello Jonh,
You can use the DragDropService to achieve this functionality. Here is a example with ToolWindows. The second ToolWindow supports drag & drop operations from the content area of window:
using
System;
using
System.Drawing;
using
System.Windows.Forms;
using
Telerik.WinControls.UI.Docking;
namespace
Lab.Dock
{
public
partial
class
DockNotFrameFloatingForm : Form
{
private
RadDock radDock =
new
RadDock();
public
DockNotFrameFloatingForm()
{
InitializeComponent();
radDock.Dock = DockStyle.Fill;
radDock.Parent =
this
;
radDock.BringToFront();
radDock.FloatingWindowCreated += radDock_FloatingWindowCreated;
}
void
radDock_FloatingWindowCreated(
object
sender, FloatingWindowEventArgs e)
{
e.Window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
}
protected
override
void
OnLoad(EventArgs e)
{
base
.OnLoad(e);
ToolWindow tool =
new
ToolWindow(
"Tool1"
);
radDock.DockWindow(tool, DockPosition.Left);
tool =
new
ToolWindow(
"Tool2"
);
tool.MouseMove += tool_MouseMove;
tool.MouseDown += tool_MouseDown;
tool.MouseUp += tool_MouseUp;
radDock.DockWindow(tool, DockPosition.Left);
tool =
new
ToolWindow(
"Tool3"
);
radDock.DockWindow(tool, DockPosition.Left);
}
void
tool_MouseUp(
object
sender, MouseEventArgs e)
{
beginDrag =
false
;
radDock.GetService<DragDropService>().Stop(
true
);
}
private
Point captionDragStart;
private
bool
beginDrag =
false
;
void
tool_MouseDown(
object
sender, MouseEventArgs e)
{
captionDragStart = Control.MousePosition;
beginDrag =
true
;
}
void
tool_MouseMove(
object
sender, MouseEventArgs e)
{
if
(e.Button == System.Windows.Forms.MouseButtons.Left && ((DockWindow)sender).DockState == DockState.Floating && beginDrag && DockHelper.ShouldBeginDrag(Control.MousePosition,
this
.captionDragStart))
{
radDock.GetService<DragDropService>().Start(sender, Control.MousePosition);
}
}
}
}
I hope this helps.
All the best,
Julian Benkov
the Telerik team