次のサンプルコードは、指定したセル、列、行、またはモデルデフォルトの直接スタイルを設定して返します。
FarPoint.Win.Spread.Model.ISheetStyleModel ssm;
FarPoint.Win.Spread.NamedStyle ns = new FarPoint.Win.Spread.NamedStyle("StyleData");
FarPoint.Win.Spread.StyleInfo si;
ssm = (FarPoint.Win.Spread.Model.ISheetStyleModel)fpSpread1.ActiveSheet.Models.Style;
ns.BackColor = Color.Yellow;
fpSpread1.NamedStyles.Add(ns);
ssm.SetDirectInfo(0, 0, ns);
si = ssm.GetDirectInfo(0, 0, null);
label1.Text = "The background color of the first cell is " + si.BackColor.ToString();
Dim ssm As FarPoint.Win.Spread.Model.ISheetStyleModel
Dim ns As New FarPoint.Win.Spread.NamedStyle("StyleData")
Dim si As FarPoint.Win.Spread.StyleInfo
ssm = FpSpread1.ActiveSheet.Models.Style
ns.BackColor = Color.Yellow
FpSpread1.NamedStyles.Add(ns)
ssm.SetDirectInfo(0, 0, ns)
si = ssm.GetDirectInfo(0, 0, Nothing)
Label1.Text = "The background color of the first cell is " & si.BackColor.ToString()