private void tabPage1_MouseMove(object sender, MouseEventArgs e) { Point p = new Point(); p.X = e.X; p.Y = e.Y; if (ismoving) { selectedShape.move(p); tabPage1.Invalidate(); } if (shapeSelected) { if (selectedShape.getLeftBorder().Contains(p) || selectedShape.getRightBorder().Contains(p)) { this.Cursor = Cursors.SizeWE; } else if (selectedShape.getTopBorder().Contains(p) || selectedShape.getBottomBorder().Contains(p)) { this.Cursor = Cursors.SizeNS; } else { this.Cursor = Cursors.Default; } if (isResize) { if (resizeLeft) { selectedShape.resizeFromLeft(p); tabPage1.Invalidate(); } if (resizeTop) { selectedShape.resizeFromTop(p); tabPage1.Invalidate(); } if (resizeRight) { selectedShape.resizeFromRight(p); tabPage1.Invalidate(); } if (resizeBottom) { selectedShape.resizeFromBottom(p); tabPage1.Invalidate(); } } } }