protected override void OnPaintBackground(PaintEventArgs e) { if (this.Focused && !this.ReadOnly) { e.Graphics.Clear(this.m_textBox.BackColor); } else if (this.VisualStyle == Resco.Controls.NumericUpDown.VisualStyle.VistaStyle) { GradientFill.DrawVistaGradient(e.Graphics, this.BackColor, new Rectangle(0, 0, base.Width, base.Height), FillDirection.Vertical); } else if (this.VisualStyle == Resco.Controls.NumericUpDown.VisualStyle.Gradients) { GradientFill.Fill(e.Graphics, base.ClientRectangle, base.ClientRectangle, this.m_gradientColors); } else { base.OnPaintBackground(e); } }
protected override void OnPaintBackground(PaintEventArgs e) { Color aColor = base.Capture ? ((this.PressedBackColor == Color.Transparent) ? this.ForeColor : this.PressedBackColor) : this.BackColor; if (this.m_visualStyle == Resco.Controls.NumericUpDown.VisualStyle.VistaStyle) { GradientFill.DrawVistaGradient(e.Graphics, aColor, base.ClientRectangle, FillDirection.Vertical); } else if (this.m_visualStyle == Resco.Controls.NumericUpDown.VisualStyle.Gradients) { GradientFill.Fill(e.Graphics, base.ClientRectangle, base.ClientRectangle, base.Capture ? this.m_gradientColorsPressed : this.m_gradientColors); } else if (this.m_visualStyle == Resco.Controls.NumericUpDown.VisualStyle.Images) { Image image = null; if (base.Capture) { image = ((e.Graphics.DpiX == 192f) && (this.m_imageVgaPressed != null)) ? this.m_imageVgaPressed : (image = this.m_imagePressed); } if (image == null) { image = ((e.Graphics.DpiX == 192f) && (this.m_imageVgaDefault != null)) ? this.m_imageVgaDefault : this.m_imageDefault; } if (image != null) { e.Graphics.DrawImage(image, base.ClientRectangle, new Rectangle(0, 0, image.Width, image.Height), GraphicsUnit.Pixel); } else { e.Graphics.Clear(aColor); } } else { e.Graphics.Clear(aColor); } }