/// <summary> /// Raises the MouseUp event. /// </summary> /// <param name="e">A MouseEventArgs that contains data about the OnMouseUp event.</param> protected override void OnMouseUp(MouseEventArgs e) { if (CaptionRectangle.Contains(e.X, e.Y)) { if ((ShowCloseIcon == false) && (ShowExpandIcon == false)) { OnExpandClick(this, EventArgs.Empty); } else if (ShowCloseIcon && (ShowExpandIcon == false)) { if (RectangleCloseIcon.Contains(e.X, e.Y) == false) { OnExpandClick(this, EventArgs.Empty); } } if (ShowExpandIcon) { if (RectangleExpandIcon.Contains(e.X, e.Y)) { OnExpandClick(this, EventArgs.Empty); } } if (ShowCloseIcon && _bIsClosable) { if (RectangleCloseIcon.Contains(e.X, e.Y)) { OnCloseClick(this, EventArgs.Empty); } } } }
protected override void OnMouseUp(MouseEventArgs e) { if (base.CaptionRectangle.Contains(e.X, e.Y)) { if (!ShowCloseIcon && !ShowExpandIcon) { OnExpandClick(this, EventArgs.Empty); } else if (ShowCloseIcon && !ShowExpandIcon && !RectangleCloseIcon.Contains(e.X, e.Y)) { OnExpandClick(this, EventArgs.Empty); } if (ShowExpandIcon) { OnExpandClick(this, EventArgs.Empty); } if (ShowCloseIcon && m_bIsClosable && RectangleCloseIcon.Contains(e.X, e.Y)) { OnCloseClick(this, EventArgs.Empty); } } }