The following code makes a part of the text bold:
TextBlock fileNameStatus;
...
// Usually we need to clear the TextBlock text
fileNameStatus.Inlines.Clear();
fileNameStatus.Inlines.Add("Editing file: "); // Plain text
Run textRun = new Run(_fileName);
textRun.FontWeight = FontWeights.Bold; // Bold text
fileNameStatus.Inlines.Add(textRun);
The control of the font is done through the Run type and its FontXXX properties.
No comments:
Post a Comment