Silverlight Tip - How to make bold text in a textblock from the CodeBehind - Digital Tool Factory blog Silverlight Tip - How to make bold text in a textblock from the CodeBehind - Digital Tool Factory blog

Silverlight Tip – How to make bold text in a textblock from the CodeBehind

The Problem: You need to conditionally bold text in a text block, but you cannot find any way of doing so

The Cause: For inexplicable reasons, Microsoft chose not to include a FontWeight.Bold in their xaml specification

The Solution: Microsoft did include a FontWeights (note the S) class  To bold text in the codebehind, all you have to do is write this

tbbDownloader.FontWeight = FontWeights.Bold;

And presto!  Bold Text.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

 

Written By Steve French

 

2 responses to “Silverlight Tip – How to make bold text in a textblock from the CodeBehind”

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.