开发者

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};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜