.NET: Useful Properties of the Text Box Control
Provided by: FMS Development Team
You are asked to provide a form for the user to enter a
detailed description. The user should be able to use the [Enter] key to
create new lines and, if necessary, enter tab characters into the text. To
ensure the text is readable, the text should word wrap appropriately
(without the user having to press the [Enter] key at the edge of the
control). How can this be accomplished? The text box control provides a few
properties that make this task easy to accomplish.
Multiline Property – Set the value to True. The text
box displays more than one line of text in the control. Additionally, you
can resize the control vertically to set the control to its desired size.
AcceptsReturn Property – Set the value to True. This
allows a new line to be inserted into the control instead of activating the
default button on the form.
AcceptsTab Property– Set the value to True. If the
Multiline property is set to True, a tab will be inserted into the text of
WordWrap Property – Set the value to True. If the
Multiline property is set to True, the text will word wrap. Otherwise, the
text will automatically scroll horizontally when the user types past the
right edge of the control.
Return to the tips page