文字数・バイト数単位で入力制限をする方法は?

文書番号 : 18937     文書種別 : 使用方法     最終更新日 : 2005/09/14
文書を印刷する
対象製品
El Tabelle for .NET 3.0J
詳細
入力文字数または入力バイト数を制限するには、文字列型セルの MaxLength プロパティ
および LengthAsByte プロパティを使用します。

WorkBook/Sheet の場合、次のようにコーディングします。

[Visual Basic]
Dim objTextEditor As New GrapeCity.Win.ElTabelle.Editors.TextEditor
'最大文字数・バイト数を指定する
objTextEditor.MaxLength = 5
'True のときバイト単位、False のとき文字単位
objTextEditor.LengthAsByte = True
Sheet1(0, 0).Editor = objTextEditor


[C#]
GrapeCity.Win.ElTabelle.Editors.TextEditor objTextEditor =
  new GrapeCity.Win.ElTabelle.Editors.TextEditor();
//最大文字数・バイト数を指定する
objTextEditor.MaxLength = 5;
//true のときバイト単位、false のとき文字単位
objTextEditor.LengthAsByte = true;
sheet1[0, 0].Editor = objTextEditor;


MultiRowSheet の場合、次のようにコーディングします。

[Visual Basic]
Dim objTextEditor As New GrapeCity.Win.ElTabelle.Editors.TextEditor
'最大文字数・バイト数を指定する
objTextEditor.MaxLength = 5
'True のときバイト単位、False のとき文字単位
objTextEditor.LengthAsByte = True
MultiRowSheet1(0, 0, 0).Editor = objTextEditor

[C#]
GrapeCity.Win.ElTabelle.Editors.TextEditor objTextEditor =
  new GrapeCity.Win.ElTabelle.Editors.TextEditor();
//最大文字数・バイト数を指定する
objTextEditor.MaxLength = 5;
//true のときバイト単位、false のとき文字単位
objTextEditor.LengthAsByte = true;
multiRowSheet1[0, 0, 0].Editor = objTextEditor;
キーワード
HowTo

この文書は、以前は次のFAQ IDで公開されていました : 7645