[]
Gets or sets the maximum number of characters or bytes that the control can hold. This is a dependency property.
public int MaxLength { get; set; }
Public Property MaxLength As Integer
Type | Description |
---|---|
int | The number of characters or bytes determined by the
MaxLengthUnit property.
That can be entered into the control. |
The MaxLength property allows you to limit the number of characters an user can enter in the control. The default value will be set to 0, which will not limit any amount of characters. Any number greater than 0 indicates the maximum number of characters. And the MaxLengthUnit will take effect the display result with this MaxLength property.
Type | Condition |
---|---|
ArgumentException | Assigned value is less than zero. |