MESCIUS SPREAD for Windows Forms 15.0J
NegativeRed プロパティ (GeneralCellType)
使用例 

負の値を赤色で表示するかどうかを表す値を取得または設定します。
構文
'宣言
 
Public Property NegativeRed As Boolean
public bool NegativeRed {get; set;}

プロパティ値

Boolean:負の値を赤で表示する場合は True、それ以外の場合は False
使用例
次のサンプルコードは、通貨値の書式設定に使用するNumberFormatInfoを指定します。
FarPoint.Win.Spread.CellType.GeneralCellType genlcell = new FarPoint.Win.Spread.CellType.GeneralCellType();
System.Globalization.NumberFormatInfo numform = (System.Globalization.NumberFormatInfo)System.Globalization.NumberFormatInfo.CurrentInfo.Clone();
numform.CurrencySymbol = "\xA3";   
Decimal myCurrency = new Decimal( 123456 );
genlcell.NumberFormat = numform;
genlcell.NegativeRed = true;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = genlcell;
fpSpread1.ActiveSheet.Cells[0, 0].Value = myCurrency.ToString( "C", numform );
Dim genlcell As New FarPoint.Win.Spread.CellType.GeneralCellType()
Dim numform As System.Globalization.NumberFormatInfo = CType(System.Globalization.NumberFormatInfo.CurrentInfo.Clone(), System.Globalization.NumberFormatInfo)
numform.CurrencySymbol = Chr(163)
Dim myCurrency As New (Decimal)(123456)
genlcell.NumberFormat = numform
genlcell.NegativeRed = True
FpSpread1.ActiveSheet.Cells(0, 0).CellType = g
FpSpread1.ActiveSheet.Cells(0, 0).Value = myCurrency.ToString("C", numform)
参照

GeneralCellType クラス
GeneralCellType メンバ

 

 


© MESCIUS inc. All rights reserved.