FarPoint.Web.Spread 名前空間 > Appearance クラス > Merge メソッド : Merge(Object) メソッド |
現在のオブジェクトで設定が定義されていない場合のみ、個々の外観設定が、指定したオブジェクトから現在のオブジェクトにコピーされます。
現在のオブジェクトで設定が定義されていても強制的に設定をマージする場合は、Merge(Object,Boolean) メソッドを使用します。
FarPoint.Web.Spread.Appearance appr = New FarPoint.Web.Spread.Appearance(); FarPoint.Web.Spread.Appearance appr1 = New FarPoint.Web.Spread.Appearance(); FarPoint.Web.Spread.Cell acell; appr.BackColor = Color.Red; appr.ForeColor = Color.White; appr.Font.Bold = True; appr.HorizontalAlign = HorizontalAlign.Right; appr.VerticalAlign = VerticalAlign.Top; appr1.Merge(appr); acell = FpSpread1.Cells[0, 0]; acell.BackColor = appr1.BackColor; acell.ForeColor = appr1.ForeColor; acell.Font.Bold = appr1.Font.Bold; acell.HorizontalAlign = appr1.HorizontalAlign; acell.VerticalAlign = appr1.VerticalAlign; FpSpread1.ActiveSheetView.SetValue(0, 0, "Appearance Test"); FpSpread1.Columns[0].Width = 150; FpSpread1.Rows[0].Height = 60; bool bl; bl = appr.IsDefined(FarPoint.Web.Spread.AppearanceProperty.BackColor); TextBox1.Text = Convert.ToString(bl);
Dim appr As New FarPoint.Web.Spread.Appearance() Dim appr1 As New FarPoint.Web.Spread.Appearance() Dim acell As FarPoint.Web.Spread.Cell Dim prop As FarPoint.Web.Spread.AppearanceProperty Dim bl As Boolean appr.BackColor = Color.Red appr.ForeColor = Color.White appr.Font.Bold = True appr.HorizontalAlign = HorizontalAlign.Right appr.VerticalAlign = VerticalAlign.Top appr1.Merge(appr) acell = FpSpread1.Cells(0, 0) acell.BackColor = appr1.BackColor acell.ForeColor = appr1.ForeColor acell.Font.Bold = appr1.Font.Bold acell.HorizontalAlign = appr1.HorizontalAlign acell.VerticalAlign = appr1.VerticalAlign FpSpread1.ActiveSheetView.SetValue(0, 0, "Appearance Test") FpSpread1.Columns(0).Width = 150 FpSpread1.Rows(0).Height = 60 bl = appr.IsDefined(prop.BackColor) TextBox1.Text = bl