System.Windows.Forms.RichTextBox.MaxLength Property

Gets or sets the maximum number of characters the user can type or paste into the rich text box control.

Syntax

[System.ComponentModel.DefaultValue(2147483647)]
public override int MaxLength { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When this property is set to 0, the maximum length of the text that can be entered in the control is 64 KB of characters. This property is typically used when the System.Windows.Forms.RichTextBox is used to display a single line of rich text format (RTF) text. You can use this property to restrict the length of text entered in the control for values such as postal codes and telephone numbers, or to restrict the length of text entered when the data is to be entered in a database. You can limit the text entered into the control to the maximum length of the corresponding field in the database.

Note:

In code, you can set the value of the TextBoxBase.Text property to a value that has a length greater than the value specified by the TextBoxBase.MaxLength property. This property only affects text entered into the control at run time.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0