Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF - How to make part of a string bold

$
0
0

I am brand-new to WPF development.  I am an ASP.Net developer using C# and VB.Net.

I am working on my first WPF project using C#.  I have the following code:

string directions = "";

directions += "Start: " + startLocation + "\n\n";

tbDirections.Text = directions;

I would like to make the text "Start: " bold but leave the rest not bold.  tbDirections is a TextBlock control in my xaml.  How can I do this?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>