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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Color of commandbars

Thread ID:





19934 Oct 6,2004 03:33 PM UTC Oct 7,2004 10:25 AM UTC WinForms 3
Tags: Tools
Administrator [Syncfusion]
Asked On October 6, 2004 03:33 PM UTC

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 06:42 PM UTC

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 10:10 PM UTC

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 10:25 AM UTC

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.


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

Live Chat Icon For mobile
Live Chat Icon