示例#1
0
        protected override void OnSetCursor(  )
        {
            // Get mouse cursor position relative to
            // the control's coordinate space.

            BaseLineItem label = (BaseLineItem)Control;
            Point        p     = label.PointToClient(Cursor.Position);

            // Display a resize cursor if the mouse is
            // over a grab handle; otherwise show a
            // normal arrow.
            if (GetHandle(label.FromPoint).Contains(p) ||
                GetHandle(label.ToPoint).Contains(p))
            {
                Cursor.Current = Cursors.SizeAll;
            }
            else
            {
                Cursor.Current = Cursors.Default;
            }
        }
        protected override void OnMouseDragMove(int x, int y)
        {
            if (dragging)
            {
                Point p = baseLine.PointToClient(new Point(x, y));
                if (overToPoint)
                {
                    baseLine.ToPoint = p;
                }
                else
                {
                    baseLine.FromPoint = p;
                }

//				this.baseLine.Invalidate();
//				this.dragOffset = p;
            }
            else
            {
                base.OnMouseDragMove(x, y);
            }
        }