private void PageDragStart(Point pt)
{
if (DragPageNotify != null)
{
// Create a page that will be dragged
_dragPage = new KryptonPage();
_dragPage.Text = _dragNode.Text;
_dragPage.TextTitle = _dragNode.Text + " Title";
_dragPage.TextDescription = _dragNode.Text + " Description";
_dragPage.ImageSmall = ImageList.Images[int.Parse((string)_dragNode.Tag)];
_dragPage.Tag = _dragNode.Tag;
// Create a rich text box with some sample text inside
KryptonRichTextBox rtb = new KryptonRichTextBox();
rtb.Text = "This page (" + _dragPage.Text + ") contains a rich text box control as example content.";
rtb.Dock = DockStyle.Fill;
rtb.StateCommon.Border.Draw = InheritBool.False;
// Add rich text box as the contents of the page
_dragPage.Padding = new Padding(5);
_dragPage.Controls.Add(rtb);
// Give the notify interface a chance to reject the attempt to drag
PageDragCancelEventArgs de = new PageDragCancelEventArgs(PointToScreen(pt), Point.Empty, this, new KryptonPage[] { _dragPage });
DragPageNotify.PageDragStart(this, null, de);
if (de.Cancel)
{
// No longer need the temporary drag page
_dragPage.Dispose();
_dragPage = null;
}
else
{
_dragging = true;
Capture = true;
}
}
}