PowerTools SPREAD for Windows Forms 8.0J
GetEnumerator メソッド (NamedStyleCollection)


コレクション内のNamedStyleオブジェクトを列挙する IEnumeratorオブジェクトを取得します。
構文
'Declaration
 
Public Overridable Function GetEnumerator() As IEnumerator
'使用法
 
Dim instance As NamedStyleCollection
Dim value As IEnumerator
 
value = instance.GetEnumerator()
public virtual IEnumerator GetEnumerator()

戻り値の型

コレクション内のスタイルを列挙する IEnumerator インスタンス
次のサンプルコードは、コレクションを列挙して、コレクションに含まれるスタイルの名前を取得します。
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");
System.Collections.IEnumerator se;
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];
se = nsc.GetEnumerator();
listBox1.Items.AddRange(new Object[] {se.MoveNext().ToString(), se.Current.ToString()});
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")
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)
nsc.GetEnumerator.MoveNext()
For Each ns2 In nsc
Label1.Text = "The name of the second style in the collection is " & ns2.Name
nsc.GetEnumerator.MoveNext()
Next
参照

NamedStyleCollection クラス
NamedStyleCollection メンバ

 

 


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