We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Gradient backgrounds for a number of tools

Thread ID:





39902 Jan 20,2006 08:42 AM UTC Jan 20,2006 05:59 PM UTC WinForms 3
Tags: Tools
Asked On January 20, 2006 08:42 AM UTC

There are a number of tools that I need to have to provide a gradient background. XPTaskBarBox''s have the ProvideItemsBackgroundBrush() but most of the other controls do not. I need to have gradient backgrounds for the other parts of the taskbar, as well as other parts of controls that don''t have gradient options

Replied On January 20, 2006 08:43 AM UTC

Question is.. how do I do this without having to paint foreground etc....?

Mano J [Syncfusion]
Replied On 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

Replied On 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?


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon