示例#1
0
        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            RibbonControl ribbonControl = sender as RibbonControl;

            if (e.Button == MouseButtons.Left && hitInfo != null)
            {
                Size      dragSize = SystemInformation.DragSize;
                Rectangle dragRect = new Rectangle(new Point(hitInfo.HitPoint.X - dragSize.Width / 2,
                                                             hitInfo.HitPoint.Y - dragSize.Height / 2), dragSize);

                if (!dragRect.Contains(e.Location))
                {
                    link = hitInfo.Item;
                    ribbonControl.DoDragDrop(link, DragDropEffects.Move);
                    hitInfo = null;
                }
            }
        }