How can I get "ForeColor" value when control is in "MouseOver" sate?

1 Answer 83 Views
Buttons, RadioButton, CheckBox, etc General Discussions Themes and Visual Style Builder
Simos Sigma
Top achievements
Rank 2
Iron
Iron
Iron
Simos Sigma asked on 17 Aug 2022, 09:20 AM | edited on 17 Aug 2022, 09:22 AM
Hello community!!!

I am trying to get the "ForeColor" value of a "RadButton" but when it is in "MouseOver" state. Any idea how can I do that?
As you can see in my screenshot, into "Visual Style Builder" I found the "HighlightedForeColor" key for the "MouseOver" state but I don't know how to get this value into my code like I do to the example below for this "RadButton".
        public static Color RGB_Color()
        {
            RadButton Rad_Button = new RadButton();

            RadForm Rad_Form = new RadForm();
            Rad_Form.Controls.Add(Rad_Button);
            Rad_Form.ThemeName = "Office2019Dark";

            Color forecolor = new Color();
            forecolor = Rad_Button.ForeColor;

            Debug.WriteLine("The forecolor is : " + forecolor);
            return forecolor;
        }
Thank you for your time!!!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Aug 2022, 09:34 AM

Hello, Simos,  

Please have in mind that the different themes that are available with the Telerik UI for WinForms suite provide different design achieved by applying different style settings. Hence, if one repository for a specific element state has name X, it is not mean that the same repository will be available in another theme. 

However, in case you are using a specific theme in your application and you are absolutely sure about the repository name, it is possible to extract the color programmatically at run time. The following KB article demonstrates a sample approach:
https://docs.telerik.com/devtools/winforms/knowledge-base/modify-themes-programmatically 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Buttons, RadioButton, CheckBox, etc General Discussions Themes and Visual Style Builder
Asked by
Simos Sigma
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or