Hover over text box: grey or black?

1 Answer 87 Views
Themes and Visual Style Builder
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Ian asked on 16 May 2023, 10:49 AM

I'm using the built-in 'Fluent' Theme, and one bit I don't like is that by default the color of the text in a text box (and same for most other controls) is a mid-grey. This only turns to black when the mouse hovers over it.

Is there a simple way to change this behaviour?  To make it black all the time? It's making it hard to take video of my application being used, because the text is quite pale.

Oh, and PLEASE don't tell me that 'I just need to edit the Theme' - I don't make changes to themes very often, and each time I do, I have to re-discover how powerful - and complicated - it is. :-)

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 17 May 2023, 09:03 AM

Hi Ian,

I am assuming that you are specifying the case when the RadTextBox control is not focussed. Indeed in the Fluent theme, when the control is not focused, the text color will be mid-gray. When the mouse is over it will turn black. I have tested your case and if I specifically set the ForeColor to Black it will override the color coming from the theme. 

public Form2()
{
    InitializeComponent();
    this.radTextBox1.ForeColor = Color.Black;
}

Here is the difference: 

In the above image, the button is focused. Can you tell me if I am in the right direction?

Regards,
Dinko | Tech Support Engineer
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.

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 17 May 2023, 01:59 PM

I think your solution means I need to set foreColor of every text box? I was hoping not to have to do that. 
Dinko | Tech Support Engineer
Telerik team
commented on 18 May 2023, 06:40 AM

What you could try is to create a custom class that derives from RadTextBox. Inside its constructor, you can set the ForeColor property to Black. Then you can replace the RadTextBox controls in your application with the custom class. Could this approach work for you?

public class BlackTextBox : RadTextBox
{
    public BlackTextBox()
    {
        this.ForeColor = Color.Black;
    }     
}

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 18 May 2023, 07:27 AM

Ah - that sounds like a good plan!

Thanks

Tags
Themes and Visual Style Builder
Asked by
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or