question

65010773 avatar image
0 Votes"
65010773 asked ·

What is the code for no brush in uwp

Hi

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

Thanks

windows-uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

65010773 avatar image
0 Votes"
65010773 answered ·

Hi

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

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for sharing the solution, you can mark your own answer to help others.

0 Votes 0 ·
FayWang-MSFT avatar image
0 Votes"
FayWang-MSFT answered ·

Hello,

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.

.cs:

 Titlechart.Background = null;


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.