PowerTools SPREAD for ASP.NET 8.0J
IsDefined メソッド (Appearance)

外観プロパティを含むAppearancePropertyオブジェクト
指定した外観プロパティが設定されているかどうかを表すブール値を返します。
構文
'Declaration
 
Public Overridable Function IsDefined( _
   ByVal prop As AppearanceProperty _
) As Boolean
public virtual bool IsDefined( 
   AppearanceProperty prop
)

パラメータ

prop
外観プロパティを含むAppearancePropertyオブジェクト

戻り値の型

プロパティが設定されている場合は True、それ以外の場合は False
解説

このメソッドを使用し、外観のプロパティの1つがオブジェクトに設定されているかどうかをチェックします。プロパティのリストについては、AppearancePropertyクラスのメンバ一覧を参照してください。

この例では、2つのAppearanceオブジェクトと1つのCellオブジェクトを作成します。1番目のAppearanceオブジェクトにいくつかのプロパティを設定し、それらを2番目のインスタンスにコピーします。次に、2番目のAppearanceオブジェクトのプロパティをCellオブジェクトの対応するプロパティに適用します。その後、AppearanceオブジェクトのBackColorプロパティが定義されているかどうかを問い合わせ、結果をテキストボックスに返します。
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.Copy(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.SetCellValue(0, 0, "AppearanceTest");
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()
appr.BackColor = Color.Red
appr.ForeColor = Color.White
appr.Font.Bold = True
appr.HorizontalAlign = HorizontalAlign.Right
appr.VerticalAlign = VerticalAlign.Top
appr1.Copy(appr)
Dim acell As FarPoint.Web.Spread.Cell
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.SetCellValue(0, 0, "AppearanceTest")
FpSpread1.Columns(0).Width = 150
FpSpread1.Rows(0).Height = 60
Dim prop As FarPoint.Web.Spread.AppearanceProperty
Dim bl As Boolean
bl = appr.IsDefined(prop.BackColor)
TextBox1.Text = bl
参照

Appearance クラス
Appearance メンバ

 

 


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