public override void OnLostFocus() { this.isDragging = false; // stop dragging if cursor was lost base.OnLostFocus(); }