Older Version
Newer Version
StPendl
Apr 19, 2010
- "removed one CR to allow for automatic wrapping in the static control demo"
StPendl
Apr 19, 2010
- "removed one CR to allow for automatic wrapping in the static control demo"
Table of Contents
Displaying Multi-Line Text
by -Every now and then one needs to display text of multiple lines, which the user should not be able to change. Using one STATICTEXT control for each line is cumbersome, but the STATICTEXT control is a multi-line control. Many programmers are not aware that a static control has automatic text line wrapping.
The following are some ways to display multiple lines of text.
Using a StaticText Control
This allows the user to read the text, but he cannot select and copy the contents. The text is broken into separate lines by adding a carriage-return character when a new line is desired. The carriage-return character is character 13 and is specified with the CHR$() statement as CHR$(13).Using a TextBox with Scroll-Bar
This allows the user to read the text and he can select and copy anything. You can display a whole plain text file in a small space.