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
close icon

Managed Colors with Office 2010 style

Good morning. I am struggling to understand how to use the ButtonAdv control with office 2010 and managed style colors.
Running Windows 8.1 I do not get the desired result.
I would like a red button RGB (225; 0; 30) with the same intensity of Office2010. Black,
is it possible?

Thank you

Roberto Guerzoni

4 Replies

PA Paul Anderson S Syncfusion Team March 25, 2014 03:44 AM UTC

Hi Roberto,

Thank you for using syncfusion products.

We would like to le t you know that your requirement can be achieved by using the buttons Paint event and apply the needed gradient to it. We have created a simple sample that applies the gradient color. Please customize the colors according to your requirement.

Please let us know if you have any concerns.

Regards,
Paul Anderson S

Attachment: WindowsFormsApplication223_22c5fbc0.zip


RG Roberto Guerzoni March 25, 2014 07:30 AM UTC

Hi Paul,
 thanks so much for the quick response, I was not able to figure out that I could use this event to customize the control.
Have a nice day

Roberto Guerzoni


RG Roberto Guerzoni March 26, 2014 01:38 PM UTC

Hello Paul, I tried your example but I am not satisfied with the look of the button. 
I have seen that the only way to get a gradient equal to the one used by ButtonAdv is to call the function PaintGradientDefault (e.Graphics, e.ClipRectangle, Color.FromArgb (225, 0, 30), Color.FromArgb (180, 00 , 30)); 

This function is inside the render Office2010 and private. How can I create a control derived from ButtonAdv and replace the color in the call PaintGradientDefault? I have not seen specific functions that enable me to derive the paint events.

Thank you
Roberto Guerzoni

Attachment: buttonadv_3dd28c98.zip


PA Paul Anderson S Syncfusion Team March 31, 2014 07:24 AM UTC

Hi Roberto,

Thanks for the update.

We would like to let you know that currently there is no support in ButtonAdv to provide customrenderer. the PaintGradientDefault() is kept as private which cannot be accessed. Please make use of the Button's Paint method and use the desired gradient layers as provided in our last sample.

Please make use of the below color combinations and if needed change the colors as needed.

cb.Colors = new Color[] { Color.FromArgb(223,0,30), Color.FromArgb(213,0,30), Color.FromArgb(207,0,30),
                    Color.FromArgb(194,0,30), Color.FromArgb(182,0,30), Color.FromArgb(178,0,30),
                    Color.FromArgb(179,0,30), Color.FromArgb(181,0,30), Color.FromArgb(184,0,30), 
                   Color.FromArgb(188,0,30), Color.FromArgb(194,0,30), Color.FromArgb(200,0,30)};

Please let us know if you have any concerns.

Regards.
Paul Anderson S

Loader.
Live Chat Icon For mobile
Up arrow icon