PowerTools SPREAD for Windows Forms 8.0J
MaximumValue プロパティ (NumberCellType)


ユーザー入力可能な最大値を取得または設定します。
構文
'Declaration
 
Public Property MaximumValue As Double
'使用法
 
Dim instance As NumberCellType
Dim value As Double
 
instance.MaximumValue = value
 
value = instance.MaximumValue
public double MaximumValue {get; set;}

プロパティ値

セルに入力できる最大値を表す倍精度浮動小数点数
例外
例外説明
System.ArgumentOutOfRangeException指定された値が制限値を超えています。
解説

MinimumValueプロパティとMaximumValueプロパティは、セル編集時にユーザーが入力する値を制限します。これはデータモデルには影響を与えません。また、数式やコードなどの他の手段でセルの値を取得する場合には、この制限は適用されません。

数式で使用する組み込み演算子と組み込み関数は、結果をDouble(15桁)で返します。

MinimumValueプロパティとMaximumValueプロパティは、ユーザーによる入力値を特定の範囲に制限する場合に使用します。たとえば次のコードは、ユーザーによる入力値を0〜100に制限します。

       NumberCellType nct = new NumberCellType();
nct.MinimumValue = 0.0;
nct.MaximumValue = 100.0;
spread.Sheets[0].Cells[0,0].CellType = nct;

MIN関数とMAX関数は、数式の計算結果を特定の範囲に制限する場合に使用します。たとえば次のコードは、加算結果を0〜100に制限します。

       spread.Sheets[0].Cells[4,0].Formula = "MAX(0, MIN(SUM(A1:A4), 100))";
次のサンプルコードは、数値型セルのいくつかのプロパティを設定します。
FarPoint.Win.Spread.CellType.NumberCellType num = new FarPoint.Win.Spread.CellType.NumberCellType();
num.DecimalPlaces = 3;
num.DecimalSeparator = ",";
num.FixedPoint = true;
num.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional;
num.MaximumValue = 50000.0;
num.MinimumValue = -1000.0;
num.NegativeFormat = FarPoint.Win.Spread.CellType.NegativeFormat.Parentheses;
num.NegativeRed = true;
num.Separator = "/";
num.ShowSeparator = true;
num.SpinButton = true;
num.SpinDecimalIncrement = 10;
num.SpinIntegerIncrement = 5;
num.SpinWrap = true;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = num;
fpSpread1.ActiveSheet.Cells[0, 0].Value = -443.0908;
Dim num As New FarPoint.Win.Spread.CellType.NumberCellType()
num.DecimalPlaces = 3
num.DecimalSeparator = ","
num.FixedPoint = True
num.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional
num.MaximumValue = 50000.0
num.MinimumValue = -1000.0
num.NegativeFormat = FarPoint.Win.Spread.CellType.NegativeFormat.Parentheses
num.NegativeRed = True
num.Separator = "/"
num.ShowSeparator = True
num.SpinButton = True
num.SpinDecimalIncrement = 10
num.SpinIntegerIncrement = 5
num.SpinWrap = True
FpSpread1.ActiveSheet.Cells(0, 0).CellType = num
FpSpread1.ActiveSheet.Cells(0, 0).Value = 443.9098
参照

NumberCellType クラス
NumberCellType メンバ
MinimumValue プロパティ

 

 


© 2004-2015, GrapeCity inc. All rights reserved.