Disbled Textbox foreground

2 posts, 1 answers
  1. Michael
    Michael avatar
    34 posts
    Member since:
    Oct 2009

    Posted 04 Sep 2013 Link to this post

    I've applied the Office_Blue theme to all TextBox controls.
    When the TextBox is disabled, the text appears very transparent and is almost unreadable. I've tried to change the opacity with a trigger, but this doesn't work. Any ideas how to solve that?

    Thanks,
    Michael

    <Style TargetType="{x:Type TextBox}">
       <Setter Property="t:StyleManager.Theme" Value="Office_Blue"  />
       <Style.Triggers>
          <Trigger Property="IsEnabled" Value="False">    
             <Setter Property="TextBox.Foreground" Value="Black" />
             <!--does not work: -->
             <Setter Property="TextBox.Opacity" Value="1" />
          </Trigger>
       </Style.Triggers>
    </Style>

  2. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 09 Sep 2013 Link to this post

    Hi Michael,



    Due to template structure of a TextBox with a simple style you would not change the style of this element in its Disabled state. If you want to make the text more readable you should predefine the template of TextBox for the particular Telerik theme and modify the opacity from there.
    Have a great day!



    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top