| Visual Basic (Declaration) | |
|---|---|
Public Overridable Property MaxLength As Integer | |
| Visual Basic (Usage) | Copy Code |
|---|---|
| |
| C# | |
|---|---|
public virtual int MaxLength {get; set;} | |
Return Value
Integer maximum number of characters| C# | Copy Code |
|---|---|
control.EditModeCursorPosition = FarPoint.Win.EditModeCursorPosition.LastKnownPosition; | |
| Visual Basic | Copy Code |
|---|---|
control.EditModeCursorPosition = FarPoint.Win.EditModeCursorPosition.LastKnownPosition | |
When the user or code attempts to insert or provide more characters than the maximum length of the control, a UserError event occurs. To prevent validation until the control loses focus, set the UserEntry property to UserEntry.FreeFormat. With the UserEntry property set to FreeFormat, if the user or code inserts or provides more characters than the maximum length of the control, an InvalidData event occurs when the control loses focus.
| Caution: If the control is bound to a database field that contains more characters than the limit specified by the MaxLength property, the data from the database is truncated in the control. If the value changes, the changed, possibly truncated, value is written to the database. |
This property is available at run time only.