当前位置: 动力学知识库 > 问答 > 编程问答 >

winforms - justified alignment using TextFormatFlags c#

问题描述:

I want justified alignment of text in a rectangle. I am using TextFormatFlags.WordBreak. It properly aligns text to the left, but not to the right side.

The code I'm using for this is:

Rectangle rect1 = new Rectangle(0, 10, 700, 200);

Rectangle rect2 = new Rectangle(160, 50, 300, 500);

// Specify the text is wrapped.

TextFormatFlags flags = TextFormatFlags.WordBreak;

TextRenderer.DrawText(e.Graphics, textBox1.Text, Headerfont, rect1, Color.Black, flags);

分享给朋友:
您可能感兴趣的文章:
随机阅读: