Answers for "wpf text box color"

C#
0

how to change color of part from the text in textblock wpf

1.
TextBlock textBlock = new TextBlock { Inlines = { new Run { Text = "some text: " }, new Run { Text = "some text", Foreground = Brushes.White } } };

2.
textblock.Inlines.Clear();
textblock.Inlines.Add(new Run("text"));
textblock.Inlines.Add(new Run("text") { Foreground = Brushes.White });
Posted by: Guest on October-12-2021
-1

change text color wpf

Lable.Foreground="somecolor"
Posted by: Guest on June-02-2020

C# Answers by Framework

Browse Popular Code Answers by Language