Lineargradientbrush foreground of texbox

Shay Wilner 1,746 Reputation points
2020-07-31T11:43:24.093+00:00

Hi

i set the foreground of a textbox as gradient but it has no effect

14777-xaml.png

Thanks

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,861 Reputation points
    2020-07-31T12:51:07.223+00:00

    Lineargradientbrush foreground of texbox

    Hello,
    Welcome to Microsoft Q&A,

    I'm afraid you can't set LinearGradientBrush for TextBox, Because the TextBox Foreground does not support LinearGradientBrush. You could only set LinearGradientBrush for Background or placeholder for TextBox.
    And if you want to set solid color for the Foreground. Please refer this document . And you could also use the following directly

    <SolidColorBrush x:Key="TextControlForeground" Color="Red"/>  
    <SolidColorBrush x:Key="TextControlForegroundPointerOver" Color="Red"/>  
    <SolidColorBrush x:Key="TextControlForegroundFocused" Color="Red"/>  
    <SolidColorBrush x:Key="TextControlForegroundDisabled" Color="Red"/>  
    

    Thanks
    Nico Zhu

    0 comments No comments

0 additional answers

Sort by: Most helpful