金額入力用のセルを作成するには?
対象製品
El Tabelle for .NET 3.0J
詳細
金額入力用のセルを作成するには、数値型セルを使用して通貨記号を表示します。
[Visual Basic]
[C#]
MultiRowSheet コントロールでは、次のようになります。
[Visual Basic]
[C#]
[Visual Basic]
Imports GrapeCity.Win.ElTabelle
Imports GrapeCity.Win.ElTabelle.Editors
Dim objCurrencyEditor As NumberEditor = _
New NumberEditor
'ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown
'桁の区切り記号を設定する
objCurrencyEditor.Separator = Microsoft.VisualBasic.ChrW(44)
'通貨記号を設定する
objCurrencyEditor.CurrencySymbol = "¥"
'入力書式を設定する
objCurrencyEditor.Format = New NumberFormat( _
"###,###,###", "", "", "-", "", "", "")
'表示書式を設定する
objCurrencyEditor.DisplayFormat = _
New NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "")
Sheet1(0, 0).Editor = objCurrencyEditor
Sheet1(0, 0).Value = 12345
Imports GrapeCity.Win.ElTabelle.Editors
Dim objCurrencyEditor As NumberEditor = _
New NumberEditor
'ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown
'桁の区切り記号を設定する
objCurrencyEditor.Separator = Microsoft.VisualBasic.ChrW(44)
'通貨記号を設定する
objCurrencyEditor.CurrencySymbol = "¥"
'入力書式を設定する
objCurrencyEditor.Format = New NumberFormat( _
"###,###,###", "", "", "-", "", "", "")
'表示書式を設定する
objCurrencyEditor.DisplayFormat = _
New NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "")
Sheet1(0, 0).Editor = objCurrencyEditor
Sheet1(0, 0).Value = 12345
[C#]
using GrapeCity.Win.ElTabelle;
using GrapeCity.Win.ElTabelle.Editors;
NumberEditor objCurrencyEditor = new NumberEditor();
//ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown;
//桁の区切り記号を設定する
objCurrencyEditor.Separator = ',';
//通貨記号を設定する
objCurrencyEditor.CurrencySymbol = @"¥":
//入力書式を設定する
objCurrencyEditor.Format = new NumberFormat(
"###,###,###", "", "", "-", "", "", "");
//表示書式を設定する
objCurrencyEditor.DisplayFormat =
new NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "");
sheet1[0, 0].Editor = objCurrencyEditor;
sheet1[0, 0].Value = 12345;
using GrapeCity.Win.ElTabelle.Editors;
NumberEditor objCurrencyEditor = new NumberEditor();
//ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown;
//桁の区切り記号を設定する
objCurrencyEditor.Separator = ',';
//通貨記号を設定する
objCurrencyEditor.CurrencySymbol = @"¥":
//入力書式を設定する
objCurrencyEditor.Format = new NumberFormat(
"###,###,###", "", "", "-", "", "", "");
//表示書式を設定する
objCurrencyEditor.DisplayFormat =
new NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "");
sheet1[0, 0].Editor = objCurrencyEditor;
sheet1[0, 0].Value = 12345;
MultiRowSheet コントロールでは、次のようになります。
[Visual Basic]
Imports GrapeCity.Win.ElTabelle
Imports GrapeCity.Win.ElTabelle.Editors
Dim objCurrencyEditor As NumberEditor = _
New NumberEditor
'ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown
'桁の区切り記号を設定する
objCurrencyEditor.Separator = Microsoft.VisualBasic.ChrW(44)
'通貨記号を設定する
objCurrencyEditor.CurrencySymbol = "¥"
'入力書式を設定する
objCurrencyEditor.Format = New NumberFormat( _
"###,###,###", "", "", "-", "", "", "")
'表示書式を設定する
objCurrencyEditor.DisplayFormat = _
New NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "")
MultiRowSheet1(0, 0, 0).Editor = objCurrencyEditor
MultiRowSheet1(0, 0, 0).Value = 12345
Imports GrapeCity.Win.ElTabelle.Editors
Dim objCurrencyEditor As NumberEditor = _
New NumberEditor
'ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown
'桁の区切り記号を設定する
objCurrencyEditor.Separator = Microsoft.VisualBasic.ChrW(44)
'通貨記号を設定する
objCurrencyEditor.CurrencySymbol = "¥"
'入力書式を設定する
objCurrencyEditor.Format = New NumberFormat( _
"###,###,###", "", "", "-", "", "", "")
'表示書式を設定する
objCurrencyEditor.DisplayFormat = _
New NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "")
MultiRowSheet1(0, 0, 0).Editor = objCurrencyEditor
MultiRowSheet1(0, 0, 0).Value = 12345
[C#]
using GrapeCity.Win.ElTabelle;
using GrapeCity.Win.ElTabelle.Editors;
NumberEditor objCurrencyEditor = new NumberEditor();
//ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown;
//桁の区切り記号を設定する
objCurrencyEditor.Separator = ',';
//通貨記号を設定する
objCurrencyEditor.CurrencySymbol = @"¥":
//入力書式を設定する
objCurrencyEditor.Format = new NumberFormat(
"###,###,###", "", "", "-", "", "", "");
//表示書式を設定する
objCurrencyEditor.DisplayFormat =
new NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "");
multiRowSheet1[0, 0, 0].Editor = objCurrencyEditor;
multiRowSheet1[0, 0, 0].Value = 12345;
using GrapeCity.Win.ElTabelle.Editors;
NumberEditor objCurrencyEditor = new NumberEditor();
//ドロップダウン電卓を非表示にする
objCurrencyEditor.ShowDropDown = Visibility.NotShown;
//桁の区切り記号を設定する
objCurrencyEditor.Separator = ',';
//通貨記号を設定する
objCurrencyEditor.CurrencySymbol = @"¥":
//入力書式を設定する
objCurrencyEditor.Format = new NumberFormat(
"###,###,###", "", "", "-", "", "", "");
//表示書式を設定する
objCurrencyEditor.DisplayFormat =
new NumberFormat("###,###,###", "$ ", "", "$ -", "", "", "");
multiRowSheet1[0, 0, 0].Editor = objCurrencyEditor;
multiRowSheet1[0, 0, 0].Value = 12345;
キーワード
HowTo
この文書は、以前は次のFAQ IDで公開されていました : 6984