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.

Color of commandbars

Thread ID:

Created:

Updated:

Platform:

Replies:

19934 Oct 6,2004 11:33 AM Oct 7,2004 06:25 AM Windows Forms 3
loading
Tags: Tools
Administrator [Syncfusion]
Asked On October 6, 2004 11:33 AM

When I change the color of the commandbar''s background to blue, I can still see a "border" at the top and bottom edge. It is gray. Is there anyway to eliminate this effect?

Administrator [Syncfusion]
Replied On October 6, 2004 02:42 PM

Hi, As a workaround handle the CommandBar''s Paint event to custom paint it instead of its BackColor property. private void commandBar1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { LinearGradientBrush brush = new LinearGradientBrush(this.commandBar1.Bounds, Color.Yellow, Color.Red, 45, true); e.Graphics.FillRectangle(brush, this.commandBar1.Bounds.X, this.commandBar1.Bounds.Y, this.commandBar1.Bounds.Width, this.commandBar1.Bounds.Height); } Please refer to the test sample that illustrates this and let me know if this meets your requirements. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On October 6, 2004 06:10 PM

Hi Guru, Thanks for the reply and sample code. I''m sorry, but, I should have told you that I was using an XPMenu Bar and not a CommandBar and as such, the sample code does not work for an XPMenu Bar :( Can it be done for the latter?

Administrator [Syncfusion]
Replied On October 7, 2004 06:25 AM

Hi, Please refer to the sample attached here that shows how you could custom paint the XPMenus.Bar : Bar Painting Sample Regards, Guru Patwal Syncfusion, Inc.

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.

;