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

コントロールに保持できる最大文字数をバイト、文字、テキスト要素のいずれに基づいて取り扱うかを取得または設定します。
構文
'Declaration
 
Public Property MaxLengthUnit As LengthUnit
public LengthUnit MaxLengthUnit {get; set;}

プロパティ値

The value<b>MaxLength</b> がバイトに基づく場合は true。文字に基づく場合は false。<br />
既定値は <b>LengthUnit.Char</b> です。
解説
<see cref="P:GrapeCity.Win.Spread.InputMan.CellType.GcTextBox.MaxLength" />プロパティをカウントする際の単位を決定します。値が<b>LengthUnit.Byte</b>の場合、MaxLengthはバイト単位でカウントされます。値が<b>LengthUnit.Char</b>の場合、MaxLengthは文字単位でカウントされます。値が<b>LengthUnit.TextElement</b>の場合、MaxLengthはテキスト要素単位でカウントされます。
次のサンプルコードは、MaxLengthUnit プロパティを使用します。
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.