Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDictionary.Remove Method

When implemented by a class, removes the element with the specified key from the IDictionary.

[Visual Basic]
Sub Remove( _
   ByVal key As Object _
void Remove(
   object key
void Remove(
   Object* key
function Remove(
   key : Object


The key of the element to remove.


Exception Type Condition
ArgumentNullException key is a null reference (Nothing in Visual Basic).
NotSupportedException The IDictionary is read-only.


The IDictionary has a fixed size.


In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hashtable.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

IDictionary Interface | IDictionary Members | System.Collections Namespace

© 2018 Microsoft