This documentation is archived and is not being maintained.

EventHandlerList.Item Property

Gets or sets the delegate for the specified object.

[C#] In C#, this property is the indexer for the EventHandlerList class.

[Visual Basic]
Public Default Property Item( _
   ByVal key As Object _
) As Delegate
public Delegate this[
 object key
] {get; set;}
public: __property Delegate* get_Item(
 Object* key
public: __property void set_Item(
 Object* key,
returnValue = EventHandlerListObject.Item(key);
EventHandlerListObject.Item(key) = returnValue;
returnValue = EventHandlerListObject(key);
EventHandlerListObject(key) = returnValue;

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Arguments [JScript]

An object to find in the list.

Parameters [Visual Basic, C#, C++]

An object to find in the list.

Property Value

The delegate for the specified key, or a null reference (Nothing in Visual Basic), if a delegate does not exist.


When the key is not found in the list and you provide a delegate to set the value of the key, then the key is added to the top of the list and assigned to the delegate as its value.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

EventHandlerList Class | EventHandlerList Members | System.ComponentModel Namespace | EventHandlerList