Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

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 *



En kopp kaffe!

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips