Word wrapping

2010-10-27

One limitation of the Command Line Interface control, is that it could only display as long strings of text as it’s width in characters at a time. The following text would be cut off just after “I like the way”:

Dim S As New System.Text.StringBuilder()
S.Append("Just gonna stand there and watch me burn ")
S.Append("That's all right because I like the way it hurts ")
S.Append("Just gonna stand there and hear me cry ")
S.Append("That's all right because I love the way you lie ")
S.Append("I love the way you lie")
Cli1.WriteLines(S.ToString())

Now, the WriteLines function also takes a boolean, and when True, the text will be devided into several lines, without breaking any words.

Cli1.WriteLines(True, S.ToString())

The CLI Control can be downloaded from here.

Categories: Microsoft .NET

Tags: CLIControl

Leave a Reply

Your email address will not be published. Required fields are marked *



If this is your first comment, it will be moderated before it is shown.