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

Color of commandbars

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?

3 Replies

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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?

AD Administrator Syncfusion Team 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.

Live Chat Icon For mobile
Up arrow icon