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.
Unfortunately, activation email could not send to your email. Please try again.

Gradient backgrounds for a number of tools

Thread ID:

Created:

Updated:

Platform:

Replies:

39902 Jan 20,2006 03:42 AM Jan 20,2006 12:59 PM Windows Forms 3
loading
Tags: Tools
va
Asked On January 20, 2006 03:42 AM

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

va
Replied On January 20, 2006 03:43 AM

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

Mano J [Syncfusion]
Replied On January 20, 2006 06:42 AM

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
Replied On January 20, 2006 12:59 PM

Thanks. If I wanted to also do a gradient background or the textbox of a combobox, how would I handle that?

CONFIRMATION

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.

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.

;