How to center a bold element?
Hy my example code:
Bold b = new开发者_如何学编程 Bold(new Run("TODO"));
b.FontSize = 50;
My Question is:
How to center the bold element?
I assume this is in reference to classes in System.Windows.Documents. You need to set the TextAlignment property on the thing (a Paragraph usually) that b is contained in.
The paragraph around the Run should define the alignment.
Bold b = new Bold(new Run("TODO"));
b.FontSize = 50;
var p = new Paragraph(b) {TextAlignment = TextAlignment.Center};
精彩评论