この例では、CellオブジェクトとIFormatterオブジェクトを作成します。IFormatterオブジェクトはCurrencyFormatterとして宣言し、Cellオブジェクトのフォーマッタとして使用します。これを検証するため、Cellオブジェクトのフォーマッタをテキストボックスに返します。
FarPoint.Web.Spread.Cell mycell;
FarPoint.Web.Spread.Renderer.IFormatter formatter;
mycell = FpSpread1.Cells[0, 0];
formatter = new FarPoint.Web.Spread.Renderer.CurrencyFormatter();
mycell.Formatter = formatter;
TextBox1.Text = Convert.ToString(mycell.Formatter);
Dim mycell As FarPoint.Web.Spread.Cell
Dim formatter As FarPoint.Web.Spread.Renderer.IFormatter
mycell = FpSpread1.Cells(0, 0)
formatter = New FarPoint.Web.Spread.Renderer.CurrencyFormatter()
mycell.Formatter = formatter
TextBox1.Text = Convert.ToString(mycell.Formatter)