What is the code for no brush in uwp

Shay Wilner 1,726 Reputation points


I have a textbox the backgroung is set to nobrush

the xaml file

 <TextBox x:Name="Titlechart" Background="{x:Null}" >

How to get the same in code c# or vb.net


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

Accepted answer
  1. Shay Wilner 1,726 Reputation points


    null is not declared
    but if found another solution
    .BorderThickness = New Thickness(0, 0, 0, 0)
    .Background = New SolidColorBrush(Windows.UI.Colors.Transparent)

1 additional answer

Sort by: Most helpful
  1. Fay Wang - MSFT 5,201 Reputation points


    Welcome to Microsoft Q&A!

    The method "Background="{x:Null}"" means it will create a null brush, and the Background property of TetxBox will get or set a brush that provides the background of the control. So if you want the achieve the same effect in code-behind, you just need to set the Background as null.


    Titlechart.Background = null;
    0 comments No comments