Tag Archives: justify text

Draw text wrapped to fit columns in C#

The post Draw aligned columns of data in C# shows one way to draw text in rows and columns. It uses the Graphics class’s MeasureString method to size the columns so they are big enough to display their data without … Continue reading

Posted in fonts, graphics, lists | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Make an owner-drawn ListBox that justifies columns in C#

This example shows how you can use an owner-drawn ListBox to left and right align values in columns. The following examples show different ways to align values in columns. Draw aligned columns of data in C# Format values in a … Continue reading

Posted in controls, fonts, graphics, lists, user interface | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Draw aligned columns of data in C#

This example draws a series of rows with aligned columns either left or right justified. The program uses the following code to define the data it will draw and the row and column alignments. // The values. private string[][] Values … Continue reading

Posted in fonts, graphics, lists | Tagged , , , , , , , , , , , , , , , | 6 Comments

Fully justify paragraphs of text in C#

The StringFormat class makes it fairly easy to left justify, right justify, or center a line of text, but strangely it doesn’t provide a method to fully justify a line of text (so it extends all the way to both … Continue reading

Posted in algorithms, fonts, graphics, printing, strings | Tagged , , , , , , , , , , , , , , , , , , , , | 4 Comments

Fully justify a line of text in C#

The StringFormat class makes it fairly easy to left justify, right justify, or center a line of text, but strangely it doesn’t provide a method to fully justify a line of text (so it extends all the way to both … Continue reading

Posted in fonts, graphics, printing, strings | Tagged , , , , , , , , , , , , , , , , , | 2 Comments