public void SetRectangle(Rectangle rectangle) { using (DesktopGraphics graphics = new DesktopGraphics()) { _drag.Size(rectangle, graphics); } }
protected override void OnDrag(MouseEventArgs args) { base.OnDrag(args); Rectangle bounds = GetSizedRectangle(); using (DesktopGraphics graphics = new DesktopGraphics()) { _rectangleDrag.Size(bounds, graphics); } }