NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TextBoxBase.WordWrap

Gets or sets a value indicating whether a multiline text box control automatically wraps words to the beginning of the next line when necessary.

[Visual Basic]
Public Property WordWrap As Boolean
[C#]
public bool WordWrap {get; set;}
[C++]
public: __property bool get_WordWrap();
public: __property void set_WordWrap(bool);
[JScript]
public function get WordWrap() : Boolean;
public function set WordWrap(Boolean);

Property Value

true if the multiline text box control wraps words; false if the text box control automatically scrolls horizontally when the user types past the right edge of the control. The default is true.

Remarks

If this property is set to true, vertical scroll bars are not displayed regardless of the System.WinForms.TextBox.Scrollbars property setting.

Example [Visual Basic]

The following example uses TextBox, a derived class, to create a multiline TextBox control with vertical scroll bars. This example also uses the AcceptsTab, AcceptsReturn, and WordWrap properties to make the multiline text box control useful for creating text documents.

[Visual Basic]

Public Sub CreateMultilineTextBox()
   ' Create an instance of a TextBox control.
   Dim Text1 as TextBox
   Set Text1 = New TextBox()
   
   ' Set the Multiline property to True.
   Text1.Multiline = True
   ' Add vertical scroll bars to the TextBox control.
   Text1.Scrollbars = ScrollBars.Vertical
   ' Allow the RETURN key in the TextBox control.
   Text1.AcceptsReturn = True
   ' Allow the TAB key to be entered in the TextBox control.
   Text1.AcceptsTab = True
   ' Set WordWrap to True to allow text to wrap to the next line.
   Text1.WordWrap = True
   ' Set the default text of the control.
   Text1.Text = "Welcome!"
End Sub

See Also

TextBoxBase Class | TextBoxBase Members | System.WinForms Namespace