TreeNodeCollection クラス
アセンブリ: System.Web (system.web.dll 内)


TreeNodeCollection クラスは、TreeView コントロールに存在する TreeNode オブジェクトのコレクションを格納および管理する場合に使用されます。TreeView コントロールは、その 2 つのプロパティで TreeNodeCollection クラスを使用します。このクラスは、Nodes プロパティにルート ノードを格納し、CheckedNodes プロパティに選択したノードを格納します。子ノードがある場合は、TreeNodeCollection コレクションを ChildNodes プロパティに使用して子ノードを格納することもできます。
TreeNodeCollection クラスは、コレクション内の項目にアクセスするための複数の方法をサポートしています。
-
Item インデクサを使用して、0 から始まる特定のインデックス位置にある TreeNode オブジェクトを直接取得します。
-
コレクションを反復処理するには、foreach (C#) または For Each (Visual Basic) を使用します。
TreeNode オブジェクトを追加および削除することにより、TreeNodeCollection をプログラムによって管理できます。ノードをコレクションに追加するには、Add メソッドまたは AddAt メソッドを使用します。コレクションからノードを削除するには、Remove、RemoveAt、または Clear の各メソッドを使用します。
![]() |
---|
TreeView コントロールがデータ ソースにバインドされると、Nodes コレクションと ChildNodes コレクションはバインディングが発生するたびに自動的に設定されます。バインディングとバインディングの間にコレクションに加えられた変更は、すべて失われます。これらの変更を保持するには、データ ソースを更新するか、バインドのたびにコレクションを手動でビルドし直します。 |
TreeNodeCollection には、コレクション自体の情報を取得できるプロパティとメソッドが格納されています。コレクション内の項目数を確認するには、Count プロパティを使用します。コレクションに特定の TreeNode オブジェクトが含まれているかどうかを確認する場合は、Contains メソッドを使用します。コレクション内の TreeNode オブジェクトのインデックスを取得するには、IndexOf メソッドを使用します。

プログラムで TreeNodeCollection に対してノードを追加および削除する方法を次のコード例に示します。Nodes プロパティおよび ChildNodes プロパティは、TreeNodeCollection オブジェクトを返します。
<%@ Page Language="VB" %> <script runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) If Not IsPostBack Then ' Use the Add and Remove methods to programmatically ' remove the Appendix C node and replace it with a new ' node. LinksTreeView.Nodes.Remove(LinksTreeView.Nodes(3)) LinksTreeView.Nodes.Add(New TreeNode("New Appendix C")) ' Use the AddAt and RemoveAt methods to programmatically ' remove the Chapter One node and replace it with a new node. LinksTreeView.Nodes(0).ChildNodes.RemoveAt(0) LinksTreeView.Nodes(0).ChildNodes.AddAt(0, New TreeNode("New Chapter One")) ' Use the Clear method to remove all the child nodes of the ' Chapter Two node. LinksTreeView.Nodes(0).ChildNodes(1).ChildNodes.Clear() End If End Sub </script> <html> <body> <form runat="server"> <h3>TreeNodeCollection Example</h3> <asp:TreeView id="LinksTreeView" Font-Name= "Arial" ForeColor="Blue" runat="server"> <LevelStyles> <asp:TreeNodeStyle ChildNodesPadding="10" Font-Bold="true" Font-Size="12pt" ForeColor="DarkGreen"/> <asp:TreeNodeStyle ChildNodesPadding="5" Font-Bold="true" Font-Size="10pt"/> <asp:TreeNodeStyle ChildNodesPadding="5" Font-UnderLine="true" Font-Size="10pt"/> <asp:TreeNodeStyle ChildNodesPadding="10" Font-Size="8pt"/> </LevelStyles> <Nodes> <asp:TreeNode Text="Table of Contents" Expanded="true"> <asp:TreeNode Text="Chapter One"> <asp:TreeNode Text="Section 1.0"> <asp:TreeNode Text="Topic 1.0.1"/> <asp:TreeNode Text="Topic 1.0.2"/> <asp:TreeNode Text="Topic 1.0.3"/> </asp:TreeNode> <asp:TreeNode Text="Section 1.1"> <asp:TreeNode Text="Topic 1.1.1"/> <asp:TreeNode Text="Topic 1.1.2"/> <asp:TreeNode Text="Topic 1.1.3"/> <asp:TreeNode Text="Topic 1.1.4"/> </asp:TreeNode> </asp:TreeNode> <asp:TreeNode Text="Chapter Two"> <asp:TreeNode Text="Section 2.0"> <asp:TreeNode Text="Topic 2.0.1"/> <asp:TreeNode Text="Topic 2.0.2"/> </asp:TreeNode> </asp:TreeNode> </asp:TreeNode> <asp:TreeNode Text="Appendix A" /> <asp:TreeNode Text="Appendix B" /> <asp:TreeNode Text="Appendix C" /> </Nodes> </asp:TreeView> </form> </body> </html>
<%@ Page Language="C#" %> <script runat="server"> void Page_Load(Object sender, EventArgs e) { if (!IsPostBack) { // Use the Add and Remove methods to programmatically // remove the Appendix C node and replace it with a new // node. LinksTreeView.Nodes.Remove(LinksTreeView.Nodes[3]); LinksTreeView.Nodes.Add(new TreeNode("New Appendix C")); // Use the AddAt and RemoveAt methods to programmatically // remove the Chapter One node and replace it with a new node. LinksTreeView.Nodes[0].ChildNodes.RemoveAt(0); LinksTreeView.Nodes[0].ChildNodes.AddAt(0, new TreeNode("New Chapter One")); // Use the Clear method to remove all the child nodes of the // Chapter Two node. LinksTreeView.Nodes[0].ChildNodes[1].ChildNodes.Clear(); } } </script> <html> <body> <form runat="server"> <h3>TreeNodeCollection Example</h3> <asp:TreeView id="LinksTreeView" Font-Name= "Arial" ForeColor="Blue" runat="server"> <LevelStyles> <asp:TreeNodeStyle ChildNodesPadding="10" Font-Bold="true" Font-Size="12pt" ForeColor="DarkGreen"/> <asp:TreeNodeStyle ChildNodesPadding="5" Font-Bold="true" Font-Size="10pt"/> <asp:TreeNodeStyle ChildNodesPadding="5" Font-UnderLine="true" Font-Size="10pt"/> <asp:TreeNodeStyle ChildNodesPadding="10" Font-Size="8pt"/> </LevelStyles> <Nodes> <asp:TreeNode Text="Table of Contents" Expanded="true"> <asp:TreeNode Text="Chapter One"> <asp:TreeNode Text="Section 1.0"> <asp:TreeNode Text="Topic 1.0.1"/> <asp:TreeNode Text="Topic 1.0.2"/> <asp:TreeNode Text="Topic 1.0.3"/> </asp:TreeNode> <asp:TreeNode Text="Section 1.1"> <asp:TreeNode Text="Topic 1.1.1"/> <asp:TreeNode Text="Topic 1.1.2"/> <asp:TreeNode Text="Topic 1.1.3"/> <asp:TreeNode Text="Topic 1.1.4"/> </asp:TreeNode> </asp:TreeNode> <asp:TreeNode Text="Chapter Two"> <asp:TreeNode Text="Section 2.0"> <asp:TreeNode Text="Topic 2.0.1"/> <asp:TreeNode Text="Topic 2.0.2"/> </asp:TreeNode> </asp:TreeNode> </asp:TreeNode> <asp:TreeNode Text="Appendix A" /> <asp:TreeNode Text="Appendix B" /> <asp:TreeNode Text="Appendix C" /> </Nodes> </asp:TreeView> </form> </body> </html>

System.Web.UI.WebControls.TreeNodeCollection


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TreeNodeCollection クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


Add、Remove、RemoveAt の各メソッドを使用して、個別のツリー ノードをコレクションに追加したり、コレクションから削除できます。
![]() |
---|
また、AddRange メソッドや Clear メソッドを使用すると、すべてのツリー ノードをコレクションに追加したり、コレクションから削除できます。

TreeView コントロールに顧客情報を表示するコード例を次に示します。ルート ツリー ノードに顧客名が表示され、各顧客に割り当てられた発注番号が子ツリー ノードに表示されます。この例では、1,000 人の顧客が表示され、顧客ごとに 15 の発注内容が示されます。BeginUpdate メソッドと EndUpdate メソッドを使用すると、TreeView は再描画されません。TreeView が TreeNode オブジェクトを作成して描画する間、待機 Cursor が表示されます。この例では、Order オブジェクトのコレクションを保持できる Customer オブジェクトが存在する必要があります。また、TreeView コントロールのインスタンスが Form 上に作成されている必要もあります。
' Create a new ArrayList to hold the Customer objects. Private customerArray As New ArrayList() Private Sub FillMyTreeView() ' Add customers to the ArrayList of Customer objects. Dim x As Integer For x = 0 To 999 customerArray.Add(New Customer("Customer" + x.ToString())) Next x ' Add orders to each Customer object in the ArrayList. Dim customer1 As Customer For Each customer1 In customerArray Dim y As Integer For y = 0 To 14 customer1.CustomerOrders.Add(New Order("Order" + y.ToString())) Next y Next customer1 ' Display a wait cursor while the TreeNodes are being created. Cursor.Current = New Cursor("MyWait.cur") ' Suppress repainting the TreeView until all the objects have been created. treeView1.BeginUpdate() ' Clear the TreeView each time the method is called. treeView1.Nodes.Clear() ' Add a root TreeNode for each Customer object in the ArrayList. Dim customer2 As Customer For Each customer2 In customerArray treeView1.Nodes.Add(New TreeNode(customer2.CustomerName)) ' Add a child TreeNode for each Order object in the current Customer object. Dim order1 As Order For Each order1 In customer2.CustomerOrders treeView1.Nodes(customerArray.IndexOf(customer2)).Nodes.Add( _ New TreeNode(customer2.CustomerName + "." + order1.OrderID)) Next order1 Next customer2 ' Reset the cursor to the default for all controls. Cursor.Current = System.Windows.Forms.Cursors.Default ' Begin repainting the TreeView. treeView1.EndUpdate() End Sub 'FillMyTreeView
// Create a new ArrayList to hold the Customer objects. private ArrayList customerArray = new ArrayList(); private void FillMyTreeView() { // Add customers to the ArrayList of Customer objects. for(int x=0; x<1000; x++) { customerArray.Add(new Customer("Customer" + x.ToString())); } // Add orders to each Customer object in the ArrayList. foreach(Customer customer1 in customerArray) { for(int y=0; y<15; y++) { customer1.CustomerOrders.Add(new Order("Order" + y.ToString())); } } // Display a wait cursor while the TreeNodes are being created. Cursor.Current = new Cursor("MyWait.cur"); // Suppress repainting the TreeView until all the objects have been created. treeView1.BeginUpdate(); // Clear the TreeView each time the method is called. treeView1.Nodes.Clear(); // Add a root TreeNode for each Customer object in the ArrayList. foreach(Customer customer2 in customerArray) { treeView1.Nodes.Add(new TreeNode(customer2.CustomerName)); // Add a child treenode for each Order object in the current Customer object. foreach(Order order1 in customer2.CustomerOrders) { treeView1.Nodes[customerArray.IndexOf(customer2)].Nodes.Add( new TreeNode(customer2.CustomerName + "." + order1.OrderID)); } } // Reset the cursor to the default for all controls. Cursor.Current = Cursors.Default; // Begin repainting the TreeView. treeView1.EndUpdate(); }
void FillMyTreeView() { // Add customers to the ArrayList of Customer objects. for ( int x = 0; x < 1000; x++ ) { customerArray->Add( gcnew Customer( "Customer " + x ) ); } // Add orders to each Customer object in the ArrayList. IEnumerator^ myEnum = customerArray->GetEnumerator(); while ( myEnum->MoveNext() ) { Customer^ customer1 = safe_cast<Customer^>(myEnum->Current); for ( int y = 0; y < 15; y++ ) { customer1->CustomerOrders->Add( gcnew Order( "Order " + y ) ); } } // Display a wait cursor while the TreeNodes are being created. ::Cursor::Current = gcnew System::Windows::Forms::Cursor( "MyWait.cur" ); // Suppress repainting the TreeView until all the objects have been created. treeView1->BeginUpdate(); // Clear the TreeView each time the method is called. treeView1->Nodes->Clear(); // Add a root TreeNode for each Customer object in the ArrayList. while ( myEnum->MoveNext() ) { Customer^ customer2 = safe_cast<Customer^>(myEnum->Current); treeView1->Nodes->Add( gcnew TreeNode( customer2->CustomerName ) ); // Add a child treenode for each Order object in the current Customer object. IEnumerator^ myEnum = customer2->CustomerOrders->GetEnumerator(); while ( myEnum->MoveNext() ) { Order^ order1 = safe_cast<Order^>(myEnum->Current); treeView1->Nodes[ customerArray->IndexOf( customer2 ) ]->Nodes->Add( gcnew TreeNode( customer2->CustomerName + "." + order1->OrderID ) ); } } // Reset the cursor to the default for all controls. ::Cursor::Current = Cursors::Default; // Begin repainting the TreeView. treeView1->EndUpdate(); }
// Create a new ArrayList to hold the Customer objects. private ArrayList customerArray = new ArrayList(); private void FillMyTreeView() { // Add customers to the ArrayList of Customer objects. for (int x = 0; x < 1000; x++) { customerArray.Add(new Customer("Customer" + ((Int32)x).ToString())); } // Add orders to each Customer object in the ArrayList. for (int iCtr = 0; iCtr < customerArray.get_Count(); iCtr++) { Customer customer1 = (Customer)customerArray.get_Item(iCtr); for (int y = 0; y < 15; y++) { customer1.get_CustomerOrders().Add(new Order("Order" + ((Int32)y).ToString())); } } // Display a wait cursor while the TreeNodes are being created. get_Cursor().set_Current(new Cursor("MyWait.cur")); // Suppress repainting the TreeView until all the objects have // been created. treeView1.BeginUpdate(); // Clear the TreeView each time the method is called. treeView1.get_Nodes().Clear(); // Add a root TreeNode for each Customer object in the ArrayList. for (int iCtr1 = 0; iCtr1 < customerArray.get_Count(); iCtr1++) { Customer customer2 = (Customer)customerArray.get_Item(iCtr1); treeView1.get_Nodes().Add(new TreeNode(customer2.get_CustomerName())); // Add a child treenode for each Order object in the current // Customer object. for (int iCtr2 = 0; iCtr2 < customer2.get_CustomerOrders(). get_Count(); iCtr2++) { Order order1 = (Order)customer2.get_CustomerOrders(). get_Item(iCtr2); treeView1.get_Nodes(). get_Item(customerArray.IndexOf(customer2)).get_Nodes(). Add(new TreeNode(customer2.get_CustomerName() + "." + order1.get_OrderID())); } } // Reset the cursor to the default for all controls. get_Cursor().set_Current(Cursors.get_Default()); // Begin repainting the TreeView. treeView1.EndUpdate(); } //FillMyTreeView

System.Windows.Forms.TreeNodeCollection


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TreeNodeCollection コンストラクタ ()
アセンブリ: System.Web (system.web.dll 内)


既定値を使用して TreeNodeCollection クラスの新しいインスタンスを初期化するには、このコンストラクタを使用します。通常、このコンストラクタは、親ノード (または所有者) を必要としないルート ノードのコレクションを作成する場合に使用します。
![]() |
---|
ルート以外のノードのコレクションを作成するときは、このコンストラクタではなく、owner パラメータを受け取るオーバーロードされたコンストラクタを使用して、親ノードを指定します。 |

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TreeNodeCollection コンストラクタ

名前 | 説明 |
---|---|
TreeNodeCollection () | 既定値を使用して、TreeNodeCollection クラスの新しいインスタンスを初期化します。 |
TreeNodeCollection (TreeNode) | 親ノード (または所有者) を指定して、TreeNodeCollection クラスの新しいインスタンスを初期化します。 |

TreeNodeCollection コンストラクタ (TreeNode)
アセンブリ: System.Web (system.web.dll 内)


親ノード (または所有者) を指定して TreeNodeCollection クラスの新しいインスタンスを初期化するには、このコンストラクタを使用します。通常、このコンストラクタは、親ノードを指定する必要のあるルート以外のノードのコレクションを作成する場合に使用します。
![]() |
---|
ルート ノードには親ノードがないため、ルート ノードのコレクションを作成するときは、既定のコンストラクタを使用してください。 |

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TreeNodeCollection プロパティ

名前 | 説明 | |
---|---|---|
![]() | Count | TreeNodeCollection オブジェクト内の項目の数を取得します。 |
![]() | IsSynchronized | TreeNodeCollection へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。 |
![]() | Item | TreeNodeCollection オブジェクト内の指定したインデックス位置にある TreeNode オブジェクトを取得します。 |
![]() | SyncRoot | TreeNodeCollection オブジェクトへのアクセスを同期するために使用できるオブジェクトを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | System.Web.UI.IStateManager.IsTrackingViewState | TreeNodeCollection オブジェクトがビューステートへの変更を保存しているかどうかを示す値を取得します。 |

TreeNodeCollection プロパティ
TreeNodeCollection メソッド

名前 | 説明 | |
---|---|---|
![]() | Add | 指定した TreeNode オブジェクトを TreeNodeCollection オブジェクトの末尾に追加します。 |
![]() | AddAt | 指定した TreeNode オブジェクトを、TreeNodeCollection オブジェクトの指定したインデックス位置に挿入します。 |
![]() | Clear | TreeNodeCollection オブジェクトを空にします。 |
![]() | Contains | 指定した TreeNode オブジェクトがコレクション内にあるかどうかを確認します。 |
![]() | CopyTo | TreeNodeCollection オブジェクトのすべての項目を互換性のある 1 次元の TreeNode オブジェクト配列にコピーします。コピー先の配列の指定したインデックスからコピーが開始されます。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetEnumerator | TreeNodeCollection オブジェクトを反復処理するために使用できる列挙子を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IndexOf | 指定した TreeNode オブジェクトのインデックスを確認します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | Remove | 指定した TreeNode オブジェクトを TreeNodeCollection オブジェクトから削除します。 |
![]() | RemoveAt | 指定したインデックス位置にある TreeNode オブジェクトを TreeNodeCollection オブジェクトから削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.ICollection.CopyTo | TreeNodeCollection オブジェクトのすべての項目を、互換性のある 1 次元の System.Array にコピーします。コピー先の配列の指定したインデックスからコピーが開始されます。 |
![]() | System.Web.UI.IStateManager.LoadViewState | TreeNodeCollection オブジェクトが前回保存したビューステートを読み込みます。 |
![]() | System.Web.UI.IStateManager.SaveViewState | ビューステートへの変更を System.Object に保存します。 |
![]() | System.Web.UI.IStateManager.TrackViewState | ビューステートへの変更を追跡するように TreeNodeCollection に指示します。 |

TreeNodeCollection メソッド


名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.IList.Add | ツリー ノード コレクションの末尾にオブジェクトを追加します。 |
![]() | System.Collections.IList.Contains | 指定したツリー ノードがコレクションのメンバかどうかを確認します。 |
![]() | System.Collections.IList.IndexOf | コレクション内の指定されたツリー ノードのインデックスを返します。 |
![]() | System.Collections.IList.Insert | ツリー ノード コレクション内の指定した位置に既存のツリー ノードを挿入します。 |
![]() | System.Collections.IList.Remove | 指定したツリー ノードをツリー ノード コレクションから削除します。 |

TreeNodeCollection メンバ
TreeView コントロール内の TreeNode オブジェクトのコレクションを表します。このクラスは継承できません。
TreeNodeCollection データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Count | TreeNodeCollection オブジェクト内の項目の数を取得します。 |
![]() | IsSynchronized | TreeNodeCollection へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。 |
![]() | Item | TreeNodeCollection オブジェクト内の指定したインデックス位置にある TreeNode オブジェクトを取得します。 |
![]() | SyncRoot | TreeNodeCollection オブジェクトへのアクセスを同期するために使用できるオブジェクトを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Add | 指定した TreeNode オブジェクトを TreeNodeCollection オブジェクトの末尾に追加します。 |
![]() | AddAt | 指定した TreeNode オブジェクトを、TreeNodeCollection オブジェクトの指定したインデックス位置に挿入します。 |
![]() | Clear | TreeNodeCollection オブジェクトを空にします。 |
![]() | Contains | 指定した TreeNode オブジェクトがコレクション内にあるかどうかを確認します。 |
![]() | CopyTo | TreeNodeCollection オブジェクトのすべての項目を互換性のある 1 次元の TreeNode オブジェクト配列にコピーします。コピー先の配列の指定したインデックスからコピーが開始されます。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetEnumerator | TreeNodeCollection オブジェクトを反復処理するために使用できる列挙子を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IndexOf | 指定した TreeNode オブジェクトのインデックスを確認します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | Remove | 指定した TreeNode オブジェクトを TreeNodeCollection オブジェクトから削除します。 |
![]() | RemoveAt | 指定したインデックス位置にある TreeNode オブジェクトを TreeNodeCollection オブジェクトから削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.ICollection.CopyTo | TreeNodeCollection オブジェクトのすべての項目を、互換性のある 1 次元の System.Array にコピーします。コピー先の配列の指定したインデックスからコピーが開始されます。 |
![]() | System.Web.UI.IStateManager.LoadViewState | TreeNodeCollection オブジェクトが前回保存したビューステートを読み込みます。 |
![]() | System.Web.UI.IStateManager.SaveViewState | ビューステートへの変更を System.Object に保存します。 |
![]() | System.Web.UI.IStateManager.TrackViewState | ビューステートへの変更を追跡するように TreeNodeCollection に指示します。 |
![]() | System.Web.UI.IStateManager.IsTrackingViewState | TreeNodeCollection オブジェクトがビューステートへの変更を保存しているかどうかを示す値を取得します。 |

TreeNodeCollection メンバ
TreeNodeCollection データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.IList.Add | ツリー ノード コレクションの末尾にオブジェクトを追加します。 |
![]() | System.Collections.IList.Contains | 指定したツリー ノードがコレクションのメンバかどうかを確認します。 |
![]() | System.Collections.IList.IndexOf | コレクション内の指定されたツリー ノードのインデックスを返します。 |
![]() | System.Collections.IList.Insert | ツリー ノード コレクション内の指定した位置に既存のツリー ノードを挿入します。 |
![]() | System.Collections.IList.Remove | 指定したツリー ノードをツリー ノード コレクションから削除します。 |
![]() | System.Collections.IList.Item | コレクション内の指定したインデックス位置のツリー ノードを取得または設定します。 |

Weblioに収録されているすべての辞書からTreeNodeCollectionを検索する場合は、下記のリンクをクリックしてください。

- TreeNodeCollectionのページへのリンク