VA
va
January 20, 2006 08:43 AM UTC
Question is.. how do I do this without having to paint foreground etc....?
MJ
Mano J
Syncfusion Team
January 20, 2006 11:42 AM UTC
Hi,
You should use the XPTaskBar''s paint method and use LinearGradientBrush to draw the Gradient Background.
private void xpTaskBar1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Rectangle rc = this.ClientRectangle;
int gradientWidth = rc.Width;
LinearGradientBrush lgb = new System.Drawing.Drawing2D.LinearGradientBrush( new Point(0, 0), new Point(0, gradientWidth),Color.White, Color.SandyBrown);
float[] positions = {0.0f, 0.005f, 0.95f, 1.0f};
float[] factors = {0.4f, 1.0f, 0.05f, 0.4f};
// Blend settings
Blend blend = new Blend();
blend.Factors = factors;
blend.Positions = positions;
lgb.Blend = blend;
e.Graphics.FillRectangle(lgb, 0, 0, gradientWidth, rc.Height);
lgb.Dispose();
}
Please let me know if this meets your requirements.
Regards,
Mano
VA
va
January 20, 2006 05:59 PM UTC
Thanks.
If I wanted to also do a gradient background or the textbox of a combobox, how would I handle that?