tools/Stampfer/PeterSource1_1/DockContent/VistaButton.cs
/// <summary>
/// Draws the Highlight over the top of the
/// control using the HightlightColor.
/// </summary>
/// <param name="g">The graphics object used in the paint event.</param>
Draws the Highlight over the top of the
control using the HightlightColor.
Draws the Highlight over the top of the control using the HightlightColor .
private void DrawHighlight (Graphics g)
        {
            if (this.ButtonStyle == Style.Flat && this.mButtonState == State.None) { return; }
            int alpha = (mButtonState == State.Pressed) ? 60 : 150;
            Rectangle rect = new Rectangle(0, 0, this.Width, this.Height / 2);
            using (GraphicsPath r = RoundRect(rect, CornerRadius, CornerRadius, 0, 0))
            {
                using (LinearGradientBrush lg = new LinearGradientBrush(r.GetBounds(),
                                            Color.FromArgb(alpha, this.HighlightColor),
                                            Color.FromArgb(alpha / 3, this.HighlightColor),
                                            LinearGradientMode.Vertical))
                {
                    g.FillPath(lg, r);
                }
            }
        }
private void DrawHighlight ( Graphics g ) { if ( this . ButtonStyle == Style . Flat && this . mButtonState == State . None ) { return ; } int alpha = ( mButtonState == State . Pressed ) ? 60 : 150 ; Rectangle rect = new Rectangle ( 0 , 0 , this . Width , this . Height / 2 ) ; using ( GraphicsPath r = RoundRect ( rect , CornerRadius , CornerRadius , 0 , 0 ) ) { using ( LinearGradientBrush lg = new LinearGradientBrush ( r . GetBounds ( ) , Color . FromArgb ( alpha , this . HighlightColor ) , Color . FromArgb ( alpha / 3 , this . HighlightColor ) , LinearGradientMode . Vertical ) ) { g . FillPath ( lg , r ) ; } } }
Draws the Highlight over the top of the
control using the HightlightColor.
Draws the Highlight over the top of the control using the HightlightColor .
g
Graphics
The graphics object used in the paint event.
The graphics object used in the paint event .