[]
GcCharMask型セルを使用すると、原稿用紙のようなマス目に文字を入力できます。郵便番号のような定型書式をわかりやすく表示したり、数値には桁区切り線を表示したりできるなど入力を確認しやすいUIを作成できます。
詳細については以下のトピックを参照してください。
このセル型の各プロパティおよびメソッドの詳細については、GcCharMaskCellTypeクラスを参照してください。
GcCharMaskCellTypeクラスのインスタンスを作成して、クラスの各プロパティを設定します。
セルに設定する場合はCellクラスの、行に設定する場合はRowクラスの、列に設定する場合はColumnクラスの、あるいはスタイルに設定する場合はStyleInfoクラスのCellTypeプロパティに、定義したGcCharMaskCellTypeクラスのインスタンスを割り当てます。
次のサンプルコードは、GcCharMask型セルを作成します。
GrapeCity.Win.Spread.InputMan.CellType.GcCharMaskCellType gc = new GrapeCity.Win.Spread.InputMan.CellType.GcCharMaskCellType();
gc.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.CtrlArrows;
gc.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Filter;
gc.AllowSpace = GrapeCity.Win.Spread.InputMan.CellType.AllowSpace.Wide;
gc.CharBoxes.AddRange(GrapeCity.Win.Spread.InputMan.CellType.CharBoxInfoCollection.Number1);
gc.CharBoxSpacing = 2;
gc.ClipContent = GrapeCity.Win.Spread.InputMan.CellType.ClipContent.ExcludeLiterals;
gc.ExitOnLastChar = true;
gc.FocusPosition = GrapeCity.Win.Spread.InputMan.CellType.EditorBaseFocusCursorPosition.FirstInputPosition;
gc.FormatString = "a";
gc.PaintByControl = true;
gc.RecommendedValue = "aaaaaaaaaa";
gc.ShowRecommendedValue = true;
gc.UseSpreadDropDownButtonRender = true;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = gc;
fpSpread1.ActiveSheet.Columns[0].Width = 200;
fpSpread1.ActiveSheet.Rows[0].Height = 40;
Dim GC As New GrapeCity.Win.Spread.InputMan.CellType.GcCharMaskCellType()
GC.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.CtrlArrows
GC.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Filter
GC.AllowSpace = GrapeCity.Win.Spread.InputMan.CellType.AllowSpace.Wide
GC.CharBoxes.AddRange(GrapeCity.Win.Spread.InputMan.CellType.CharBoxInfoCollection.Number1)
GC.CharBoxSpacing = 2
GC.ClipContent = GrapeCity.Win.Spread.InputMan.CellType.ClipContent.ExcludeLiterals
GC.ExitOnLastChar = True
GC.FocusPosition = GrapeCity.Win.Spread.InputMan.CellType.EditorBaseFocusCursorPosition.FirstInputPosition
GC.FormatString = "a"
GC.PaintByControl = True
GC.RecommendedValue = "aaaaaaaaaa"
GC.ShowRecommendedValue = True
GC.UseSpreadDropDownButtonRender = True
FpSpread1.ActiveSheet.Cells(0, 0).CellType = GC
FpSpread1.ActiveSheet.Columns(0).Width = 200
FpSpread1.ActiveSheet.Rows(0).Height = 40
作業領域内のセルまたはセル範囲を選択します。
プロパティ リストの「その他」カテゴリから、CellType プロパティを選択します。 ドロップダウン リストからGcCharMaskを選択します。 これによって CellType プロパティが展開され、このセル型に固有のさまざまなプロパティが表示されます。 このリストから、必要に応じてプロパティを選択および設定します。
または、セルまたはセル範囲を右クリックして[セル型]を選択します。 セル型の一覧からGcCharMask型を選択します。 セル型エディタで、必要なプロパティを設定します。 〈適用〉ボタンをクリックします。
[ファイル]メニューから[適用して終了]を選択し、変更をコンポーネントに適用して SPREAD デザイナを終了します。