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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Managed Colors with Office 2010 style

Thread ID:

Created:

Updated:

Platform:

Replies:

116042 Mar 22,2014 11:01 AM UTC Mar 31,2014 07:24 AM UTC WinForms 4
loading
Tags: ButtonAdv
Roberto Guerzoni
Asked On March 22, 2014 11:01 AM UTC

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

Paul Anderson S [Syncfusion]
Replied On 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

Roberto Guerzoni
Replied On 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

Roberto Guerzoni
Replied On 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

Paul Anderson S [Syncfusion]
Replied On 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

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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;