PowerTools SPREAD for Windows Forms 8.0J
MinimumValue プロパティ (PercentCellType)


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

プロパティ値

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

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

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

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

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

        spread.Sheets[0].Cells[4,0].Formula = "MAX(0, MIN(SUM(A1:A4), 100))";
次のサンプルコードは、パーセントで書式設定された数値型セルを作成し、各種書式プロパティを設定します。
FarPoint.Win.Spread.CellType.PercentCellType prctcell = new FarPoint.Win.Spread.CellType.PercentCellType();
prctcell.DecimalPlaces = 3;
prctcell.DecimalSeparator = ",";
prctcell.FixedPoint = true;
prctcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional;
prctcell.MaximumValue = 50000.0;
prctcell.MinimumValue = -1000.0;
prctcell.NegativeFormat = FarPoint.Win.Spread.CellType.PercentNegativeFormat.PercentAfterWithSpace;
prctcell.NegativeRed = true;
prctcell.PercentSign = "%";
prctcell.PositiveFormat = FarPoint.Win.Spread.CellType.PercentPositiveFormat.PercentAfter;
prctcell.Separator = "/";
prctcell.ShowSeparator = true;
prctcell.SpinButton = true;
prctcell.SpinDecimalIncrement = 10;
prctcell.SpinIntegerIncrement = 5;
prctcell.SpinWrap = true;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = prctcell;
fpSpread1.ActiveSheet.Cells[0, 0].Value = -443.0908;
Dim prctcell As New FarPoint.Win.Spread.CellType.PercentCellType()
prctcell.DecimalPlaces = 3
prctcell.DecimalSeparator = ","
prctcell.FixedPoint = True
prctcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional
prctcell.MaximumValue = 50000.0
prctcell.MinimumValue = -1000.0
prctcell.NegativeFormat = FarPoint.Win.Spread.CellType.PercentNegativeFormat.PercentAfterWithSpace
prctcell.NegativeRed = True
prctcell.PercentSign = "%"
prctcell.PositiveFormat = FarPoint.Win.Spread.CellType.PercentPositiveFormat.PercentAfter
prctcell.Separator = "/"
prctcell.ShowSeparator = True
prctcell.SpinButton = True
prctcell.SpinDecimalIncrement = 10
prctcell.SpinIntegerIncrement = 5
prctcell.SpinWrap = True
FpSpread1.ActiveSheet.Cells(0, 0).CellType = prctcell
FpSpread1.ActiveSheet.Cells(0, 0).Value = -443.9098
参照

PercentCellType クラス
PercentCellType メンバ
MaximumValue プロパティ

 

 


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