Share via


EnterKeyBehavior Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

                  https://msdn.microsoft.com/en-us/library/cc349284(v=office.10)         

Defines the effect of pressing ENTER in a TextBox.

Syntax

object.EnterKeyBehavior [= Boolean]

The EnterKeyBehavior property syntax has these parts:

Part Description
object Required. A valid object.
Boolean Optional. Specifies the effect of pressing ENTER.

Settings

The settings for Boolean are:

Value Description
True Pressing ENTER creates a new line.
False Pressing ENTER moves the focus to the next object in the tab order (default).

Remarks

The EnterKeyBehavior and MultiLine properties are closely related. The values described above only apply if MultiLine is True. If MultiLine is False, pressing ENTER always moves the to the next control in the regardless of the value of EnterKeyBehavior.

The effect of pressing CTRL+ENTER also depends on the value of MultiLine. If MultiLine is True, pressing CTRL+ENTER creates a new line regardless of the value of EnterKeyBehavior. If MultiLine is False, pressing CTRL+ENTER has no effect.