作成日: 2018/05/24 最終更新日: 2018/05/24
文書種別
使用方法
詳細
GcNumber型セルでは、接頭語および接尾語をリテラル文字として表示できます。接頭語/接尾語は入力用および表示用の2つがあり、それぞれNumberSignField、NumberSignDisplayField(接頭語/接尾語フィールド)で定義します。
以下のサンプルコードでは、編集中は「30」、非編集時は「件数: 30 個」と表示されます。
◎サンプルコード(VB)
◎サンプルコード(C#)
以下のサンプルコードでは、編集中は「30」、非編集時は「件数: 30 個」と表示されます。
◎サンプルコード(VB)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim gcNumberCell1 As New GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType()
' フィールドをクリア
gcNumberCell1.DisplayFields.Clear()
' 表示フィールドのオブジェクトを作成
Dim numberSignDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo("件数: ", "件数: ")
Dim numberIntegerPartDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberIntegerPartDisplayFieldInfo()
Dim numberDecimalSeparatorDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalSeparatorDisplayFieldInfo()
Dim numberDecimalPartDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalPartDisplayFieldInfo()
Dim numberSignDisplayField2 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo(" 個", " 個")
' フィールドをコレクションに追加してセルに表示書式を設定
gcNumberCell1.DisplayFields.AddRange(New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDisplayFieldInfo() {numberSignDisplayField1, numberIntegerPartDisplayField1, numberDecimalSeparatorDisplayField1, numberDecimalPartDisplayField1, numberSignDisplayField2})
gcNumberCell1.SideButtons.Clear()
FpSpread1.ActiveSheet.Columns(0).CellType = gcNumberCell1
' テストデータの設定
FpSpread1.ActiveSheet.Cells(0, 0).Value = 30
FpSpread1.ActiveSheet.Columns(0).Width = 100
End Sub
Dim gcNumberCell1 As New GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType()
' フィールドをクリア
gcNumberCell1.DisplayFields.Clear()
' 表示フィールドのオブジェクトを作成
Dim numberSignDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo("件数: ", "件数: ")
Dim numberIntegerPartDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberIntegerPartDisplayFieldInfo()
Dim numberDecimalSeparatorDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalSeparatorDisplayFieldInfo()
Dim numberDecimalPartDisplayField1 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalPartDisplayFieldInfo()
Dim numberSignDisplayField2 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo(" 個", " 個")
' フィールドをコレクションに追加してセルに表示書式を設定
gcNumberCell1.DisplayFields.AddRange(New GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDisplayFieldInfo() {numberSignDisplayField1, numberIntegerPartDisplayField1, numberDecimalSeparatorDisplayField1, numberDecimalPartDisplayField1, numberSignDisplayField2})
gcNumberCell1.SideButtons.Clear()
FpSpread1.ActiveSheet.Columns(0).CellType = gcNumberCell1
' テストデータの設定
FpSpread1.ActiveSheet.Cells(0, 0).Value = 30
FpSpread1.ActiveSheet.Columns(0).Width = 100
End Sub
◎サンプルコード(C#)
private void Form1_Load(object sender, EventArgs e)
{
GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType gcNumberCell1 = new GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType();
// フィールドをクリア
gcNumberCell1.DisplayFields.Clear();
// 表示フィールドのオブジェクトを作成
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo numberSignDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo("件数: ", "件数: ");
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberIntegerPartDisplayFieldInfo numberIntegerPartDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberIntegerPartDisplayFieldInfo();
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalSeparatorDisplayFieldInfo numberDecimalSeparatorDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalSeparatorDisplayFieldInfo();
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalPartDisplayFieldInfo numberDecimalPartDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalPartDisplayFieldInfo();
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo numberSignDisplayField2 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo(" 個", " 個");
// フィールドをコレクションに追加してセルに表示書式を設定
gcNumberCell1.DisplayFields.AddRange(new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDisplayFieldInfo[] { numberSignDisplayField1, numberIntegerPartDisplayField1, numberDecimalSeparatorDisplayField1, numberDecimalPartDisplayField1, numberSignDisplayField2 });
gcNumberCell1.SideButtons.Clear();
fpSpread1.ActiveSheet.Columns[0].CellType = gcNumberCell1;
// テストデータの設定
fpSpread1.ActiveSheet.Cells[0, 0].Value = 30;
fpSpread1.ActiveSheet.Columns[0].Width = 100;
}
{
GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType gcNumberCell1 = new GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType();
// フィールドをクリア
gcNumberCell1.DisplayFields.Clear();
// 表示フィールドのオブジェクトを作成
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo numberSignDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo("件数: ", "件数: ");
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberIntegerPartDisplayFieldInfo numberIntegerPartDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberIntegerPartDisplayFieldInfo();
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalSeparatorDisplayFieldInfo numberDecimalSeparatorDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalSeparatorDisplayFieldInfo();
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalPartDisplayFieldInfo numberDecimalPartDisplayField1 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDecimalPartDisplayFieldInfo();
GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo numberSignDisplayField2 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberSignDisplayFieldInfo(" 個", " 個");
// フィールドをコレクションに追加してセルに表示書式を設定
gcNumberCell1.DisplayFields.AddRange(new GrapeCity.Win.Spread.InputMan.CellType.Fields.NumberDisplayFieldInfo[] { numberSignDisplayField1, numberIntegerPartDisplayField1, numberDecimalSeparatorDisplayField1, numberDecimalPartDisplayField1, numberSignDisplayField2 });
gcNumberCell1.SideButtons.Clear();
fpSpread1.ActiveSheet.Columns[0].CellType = gcNumberCell1;
// テストデータの設定
fpSpread1.ActiveSheet.Cells[0, 0].Value = 30;
fpSpread1.ActiveSheet.Columns[0].Width = 100;
}
旧文書番号
82743