MESCIUS SPREAD for Windows Forms 17.0J
MaxLength プロパティ (GcTextBoxCellType)

テキストコントロールに入力できる最大文字数を取得または設定します。
構文
'Declaration
 
Public Property MaxLength As Integer
public int MaxLength {get; set;}

プロパティ値

コントロールに入力できる文字数またはバイト数(文字数とバイト数のどちらであるかは<b>LengthAsByte</b>プロパティによって決定されます)。<br />デフォルト値は<b>ゼロ</b>です。
既定値は <b>zero</b> です。
例外
例外説明
System.ArgumentOutOfRangeException 
解説
<b>MaxLength</b>プロパティを使用して、ユーザーがコントロールに入力できる文字数を制限できます。デフォルト値は0で、文字数が制限されないことを示します。0より大きい任意の数を指定すると、それが最大文字数になります。表示結果には、この<b>MaxLength</b>プロパティと共に<see cref="P:GrapeCity.Win.Spread.InputMan.CellType.GcTextBox.MaxLengthUnit" />も影響します。
次のサンプルコードは、MaxLength プロパティを使用します。
GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType inputcell1 = new GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType();
inputcell1.MaxLengthUnit = GrapeCity.Win.Spread.InputMan.CellType.LengthUnit.Char;
inputcell1.MaxLength = 10;
fpSpread1.Sheets[0].Cells[1, 1].CellType = inputcell1;
Dim inputcell1 As New GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType
inputcell1.MaxLengthUnit = GrapeCity.Win.Spread.InputMan.CellType.LengthUnit.Char
inputcell1.MaxLength = 10
fpSpread1.Sheets(0).Cells(1, 1).CellType = inputcell1
参照

GcTextBoxCellType クラス
GcTextBoxCellType メンバ

 

 


© MESCIUS inc. All rights reserved.