O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

String Alignment and Wrapping

In addition to drawing single lines of text, you can also wrap a larger amount of text within a defined rectangle. To accomplish this, you need to create a StringFormat object for the purpose of defining how you want the text to be wrapped.

The StringFormat object has two useful properties for controlling the wrapping. These properties are FormatFlags and Alignment. The FormatFlags property is based on the StringFormatFlags enumeration data type. Table 26.3 shows the values defined in this enumeration along with a brief explanation.

Table 26.3. StringFormatFlags Enumeration Values
Name Description
DirectionRightToLeft ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required