Spread Windows Forms 7.0 Product Documentation
MaxLength Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > TextCellType Class : MaxLength Property


Glossary Item Box

Gets or sets the maximum number of characters allowed in the text cell.

Syntax

Visual Basic (Declaration) 
Public Property MaxLength As Integer
Visual Basic (Usage)Copy Code
Dim instance As TextCellType
Dim value As Integer
 
instance.MaxLength = value
 
value = instance.MaxLength
C# 
public int MaxLength {get; set;}

Property Value

Integer number of characters

Remarks

This is the number of characters that can be typed, not the number that can be displayed. If you enter text by setting the Text property for a cell, this property does not limit those characters, only what can be typed by a user when in edit mode.

Example

This example specifies how text can be displayed including the letter case, the length, and whether it can wrap to multiple lines.
C#Copy Code
FarPoint.Win.Spread.CellType.TextCellType txt = new FarPoint.Win.Spread.CellType.TextCellType();
txt.CharacterCasing = CharacterCasing.Upper;
txt.CharacterSet = FarPoint.Win.Spread.CellType.CharacterSet.Ascii;
txt.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
txt.MaxLength = 40;
txt.Multiline = true;
txt.PasswordChar = Convert.ToChar("*");
txt.ScrollBars = ScrollBars.Vertical;
txt.Static = true;
fpSpread1.Sheets[0].Cells[0, 0].CellType = txt;
fpSpread1.Sheets[0].Cells[0, 0].Text = "This is a text cell.  It can provide a wide range of" + " functionality for handling
a large amount of data that a user might want to include" + " in a single cell.";
Visual BasicCopy Code
Dim txt As New FarPoint.Win.Spread.CellType.TextCellType()
txt.CharacterCasing = CharacterCasing.Upper
txt.CharacterSet = FarPoint.Win.Spread.CellType.CharacterSet.Ascii
txt.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show
txt.MaxLength = 40
txt.Multiline = True
txt.PasswordChar = "*"
txt.ScrollBars = ScrollBars.Vertical
txt.Static = True
FpSpread1.Sheets(0).Cells(0, 0).CellType = txt
FpSpread1.Sheets(0).Cells(0, 0).Text = "This is a text cell.  It can provide a wide range of" & _
" functionality for handling a large amount of data that a user might want to include" & _
" in a single cell."

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.