Skip to content

Commit 7c41424

Browse files
authored
Add ArgumentException for Item (dotnet#5259)
1 parent c483fe7 commit 7c41424

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

xml/System.Windows.Forms/TreeNodeCollection.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,11 +1265,10 @@
12651265
<remarks>
12661266
<format type="text/markdown"><![CDATA[
12671267
1268-
## Remarks
1269-
To assign <xref:System.Windows.Forms.TreeNode> objects to a specific location, or to retrieve them from the <xref:System.Windows.Forms.TreeNodeCollection>, you can reference the collection object with a specific index value. The index value of the <xref:System.Windows.Forms.TreeNodeCollection> is a zero-based index.
1270-
1271-
1272-
1268+
## Remarks
1269+
1270+
To assign <xref:System.Windows.Forms.TreeNode> objects to a specific location, or to retrieve them from the <xref:System.Windows.Forms.TreeNodeCollection>, you can reference the collection object with a specific index value. The index value of the <xref:System.Windows.Forms.TreeNodeCollection> is a zero-based index.
1271+
12731272
## Examples
12741273
The following code example removes the first <xref:System.Windows.Forms.TreeNode> from a <xref:System.Windows.Forms.TreeView> if its <xref:System.Windows.Forms.TreeNode.Text%2A?displayProperty=nameWithType> property is set to "Node0". When a <xref:System.Windows.Forms.Button> is clicked, the first <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeView> is deleted using the <xref:System.Windows.Forms.TreeNodeCollection.RemoveAt%2A> method. This example requires that you have created a <xref:System.Windows.Forms.TreeView> and a <xref:System.Windows.Forms.Button> on a <xref:System.Windows.Forms.Form>. The first <xref:System.Windows.Forms.TreeNode> in your <xref:System.Windows.Forms.TreeView> should have a text property of "Node0."
12751274
@@ -1279,7 +1278,8 @@
12791278
12801279
]]></format>
12811280
</remarks>
1282-
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> value is less than 0 or is greater than the number of tree nodes in the collection.</exception>
1281+
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> value is less than 0 or is greater than the last index in the collection.</exception>
1282+
<exception cref="T:System.ArgumentException">The <see cref="T:System.Windows.Forms.TreeNode" /> that's being assigned to this index is already assigned to a different index or to a different <see cref="T:System.Windows.Forms.TreeView" /> control.</exception>
12831283
<altmember cref="P:System.Windows.Forms.TreeNodeCollection.Count" />
12841284
</Docs>
12851285
</Member>

0 commit comments

Comments
 (0)