Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TextBoxBase.AcceptsReturn Property

 

Gets or sets a value that indicates how the text editing control responds when the user presses the ENTER key.

Namespace:   System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

public bool AcceptsReturn { get; set; }

Property Value

Type: System.Boolean

true if pressing the ENTER key inserts a new line at the current cursor position; otherwise, the ENTER key is ignored. The default value is false for TextBox and true for RichTextBox.

The ENTER key corresponds to VK_RETURN virtual-key code.

Identifier field

AcceptsReturnProperty

Metadata properties set to true

None

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft