Justify text
-
System.Drawing.StringFormat
class allows you to justify a text to left, right, top, bottom, center and middle of the clip rect. But I saw in Microsoft Word an option to justify text to both margin, so every line of text has the same width. I checked theSystem.Drawing.StringFormat
properties and didn't find out how to do this. Please help me, thanks alot. -
System.Drawing.StringFormat
class allows you to justify a text to left, right, top, bottom, center and middle of the clip rect. But I saw in Microsoft Word an option to justify text to both margin, so every line of text has the same width. I checked theSystem.Drawing.StringFormat
properties and didn't find out how to do this. Please help me, thanks alot.I've done a quick lookup, and you're right, it doesn't work, not for textbox, not for richtextbox. I read on a forum that it was just not possible at all, without using custom controls that you can buy/make. Although I would hope that Framework 3.0 or GDI+ has this functionality somewhere. I can't help you with that, but you could point your question towards them (also).
public object BufferOverFlow { __get { return BufferOverFlow; } __set { BufferOverFlow = value; } }
-
System.Drawing.StringFormat
class allows you to justify a text to left, right, top, bottom, center and middle of the clip rect. But I saw in Microsoft Word an option to justify text to both margin, so every line of text has the same width. I checked theSystem.Drawing.StringFormat
properties and didn't find out how to do this. Please help me, thanks alot.I got the problem when using Graphics object to draw text, like this
Graphics g; g.DrawString("Text", font, brush, rect, format);
with format is an instance ofSystem.Drawing.StringFormat
No way to strect the text lines to have the same width :(( Thanks for your answer anyway.