PowerTools SPREAD for Windows Forms 10.0J
AutoCalculation プロパティ (ICalculationSupport)


依存セルの内容が変更されたときにシートの各数式を自動的に再計算するかどうかを取得または設定します。
構文
'Declaration
 
Property AutoCalculation As Boolean
'使用法
 
Dim instance As ICalculationSupport
Dim value As Boolean
 
instance.AutoCalculation = value
 
value = instance.AutoCalculation
bool AutoCalculation {get; set;}

プロパティ値

Boolean:数式を自動的に再計算する場合は True、それ以外の場合は False
次のサンプルコードは、依存セルの内容が変更されたときにスプレッドシートの各数式を再計算するかどうかを設定します。
DialogResult dlg;
FarPoint.Win.Spread.Model.ICalculationSupport cs;
fpSpread1.ActiveSheet.SetValue(0, 0, 10);
fpSpread1.ActiveSheet.SetValue(0, 1, 20);
fpSpread1.ActiveSheet.SetFormula(3, 0, "SUM(A1,B1)");
dlg = MessageBox.Show("Do you want to recalculate the formula?", "AutoCalculation", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
     cs = (FarPoint.Win.Spread.Model.ICalculationSupport)fpSpread1.ActiveSheet.Models.Data;
     cs.AutoCalculation = true;
     fpSpread1.ActiveSheet.SetValue(0, 1, 50);
}
else if(dlg == DialogResult.No)
{
     cs = (FarPoint.Win.Spread.Model.ICalculationSupport)fpSpread1.ActiveSheet.Models.Data;
     cs.AutoCalculation = false;
     fpSpread1.ActiveSheet.SetValue(0, 1, 50);
}
Dim dlg As DialogResult
Dim cs As FarPoint.Win.Spread.Model.ICalculationSupport
FpSpread1.ActiveSheet.SetValue(0, 0, 10)
FpSpread1.ActiveSheet.SetValue(0, 1, 20)
FpSpread1.ActiveSheet.SetFormula(3, 0, "SUM(A1,B1)")
dlg = MessageBox.Show("Do you want to auto calc the formula?", "AutoCalculation", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
     cs = FpSpread1.ActiveSheet.Models.Data
     cs.AutoCalculation = True
     FpSpread1.ActiveSheet.SetValue(0, 1, 50)
ElseIf dlg = DialogResult.No Then
     cs = FpSpread1.ActiveSheet.Models.Data
     cs.AutoCalculation = False
     FpSpread1.ActiveSheet.SetValue(0, 1, 50)
End If
参照

ICalculationSupport インタフェース
ICalculationSupport メンバ

 

 


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