Hi snesbit,
Thanks for your posting!!
I think "Herfried K. Wagner [MVP]" gives you a good direction. Yes, with
GDI+, we may draw the entire form what style we like. The below is a little
code snippet which do something similiar as you want:
protected override void OnPaint(PaintEventArgs e)
{
Color LightColor = Color.FromArgb(245,223,162);
Color DarkColor = Color.FromArgb (207,188,136);
Rectangle r = new Rectangle(0,0, this.Width, this.Height/4);
// Create a LinearGradientBrush... the two colors specified will be
// overridden, so they don't matter.
LinearGradientBrush lb = new LinearGradientBrush(r, Color.Black
,Color.Black, 90, false);
// Setup a ColorBlend that has the color names and positions.
// Basically, an array of any amount of color/position pairs. I'm doing 3
colors
ColorBlend lbColors = new ColorBlend(3);
// Set the colors equal to a new array
lbColors.Colors = new Color[] {Color.Red, Color.Blue, DarkColor};
// Set the positions for the three colors. The range is 0.0 to 1.0 (floats)
lbColors.Positions = new float[] {0.0f, 0.8f, 1.0f};
// Set the InterpolationColors of the LinearGradientBrush to this new
ColorBlend
lb.InterpolationColors = lbColors;
// Draw the gradient.
e.Graphics.FillRectangle(lb, r);
e.Graphics.FillRectangle(lb, new Rectangle(0, this.Height*3/4, this.Width,
this.Height/4));
base.OnPaint (e);
}
You may directly copy and paste in your Form class. For your information.
Note: the sample is far from perfect, you should do a lot of improvement to
it.
Also, there is a GDI+ tutorial writen by Robert W. Powell MVP, please refer
to:
"Using The LinearGradientBrush"
http://www.bobpowell.net/linear.htm
Hope this helps
================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.