/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Control.MouseDown" /> event. /// </summary> /// <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> protected override void OnMouseDown(MouseEventArgs e) { if (this.CheckOnClick) { if (this.Checked) { this.Checked = false; } else if (!this.Checked) { this.Checked = true; } } this.CurrentState = ZeroitMetroPanelSelection.MouseState.Down; this.Invalidate(); base.OnMouseDown(e); }
/// <summary> /// Initializes a new instance of the <see cref="ZeroitMetroPanelSelection" /> class. /// </summary> public ZeroitMetroPanelSelection() { this.CurrentState = ZeroitMetroPanelSelection.MouseState.None; this._CheckOnClick = true; this._DrawBorders = true; this._Headline = "Headline Text"; this._SubText = "Sub-Text"; this._HeadlineFont = new System.Drawing.Font("Segoe UI Light", 14f); this._SubTextFont = new System.Drawing.Font("Segoe UI", 9f); this._Checked = false; this.ColorScheme = new ZeroitMetroPanelSelection.MainColorScheme(); this.Font = new System.Drawing.Font("Segoe UI", 9f); this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); this.UpdateStyles(); //this.Style = Design.Style.Light; this.Size = new System.Drawing.Size(275, 64); }
/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Control.MouseUp" /> event. /// </summary> /// <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> protected override void OnMouseUp(MouseEventArgs e) { this.CurrentState = ZeroitMetroPanelSelection.MouseState.Over; this.Invalidate(); base.OnMouseUp(e); }
/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Control.MouseLeave" /> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> protected override void OnMouseLeave(EventArgs e) { this.CurrentState = ZeroitMetroPanelSelection.MouseState.None; this.Invalidate(); base.OnMouseLeave(e); }