MESCIUS SPREAD for Windows Forms 15.0J
Remove メソッド (NamedStyleCollection)
使用例 

削除するスタイル(NamedStyleオブジェクト)
指定した名前付きスタイルをコレクションから削除します。
構文
'宣言
 
Public Overridable Sub Remove( _
   ByVal style As NamedStyle _
) 
public virtual void Remove( 
   NamedStyle style
)

パラメータ

style
削除するスタイル(NamedStyleオブジェクト)
使用例
次のサンプルコードは、指定した名前付きスタイルをコレクションから削除します。
FarPoint.Win.Spread.NamedStyleCollection nsc = new FarPoint.Win.Spread.NamedStyleCollection();
FarPoint.Win.Spread.NamedStyle ns1 = new FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault");
FarPoint.Win.Spread.NamedStyle ns2 = new FarPoint.Win.Spread.NamedStyle("StyleData", "DataAreaDefault");
DialogResult dlg;
ns1.BackColor = Color.LightBlue;
ns2.BackColor = Color.Gray;
nsc.AddRange(new Object[] {ns1, ns2});
fpSpread1.NamedStyles = nsc;
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = nsc[0];
fpSpread1.ActiveSheet.DefaultStyle = nsc[1];
label1.Text = "There are " + nsc.Count.ToString() + " named styles in the collection.";
dlg = MessageBox.Show("Do you want to remove StyleHeaders from the collection?", "Remove", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
nsc.Remove(ns1);
label1.Text = "There are " + nsc.Count.ToString() + " named styles in the collection.";
}
Dim nsc As New FarPoint.Win.Spread.NamedStyleCollection()
Dim ns1 As New FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault")
Dim ns2 As New FarPoint.Win.Spread.NamedStyle("StyleData", "DataAreaDefault")
Dim dlg As DialogResult
ns1.BackColor = Color.LightBlue
ns2.BackColor = Color.Gray
nsc.AddRange(New Object() {ns1, ns2})
FpSpread1.NamedStyles = nsc
FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = nsc(0)
FpSpread1.ActiveSheet.DefaultStyle = nsc(1)
Label1.Text = "There are " & nsc.Count.ToString() & " named styles in the collection."
dlg = MessageBox.Show("Do you want to remove StyleHeaders from the collection?", "Remove", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
nsc.Remove(ns1)
Label1.Text = "There are " & nsc.Count.ToString() & " named styles in the collection."
End If
参照

NamedStyleCollection クラス
NamedStyleCollection メンバ

 

 


© MESCIUS inc. All rights reserved.