Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

DictionaryEntry.Value Property

Definition

Namespace:
System.Collections
Assemblies:
mscorlib.dll, System.Runtime.dll
Assemblies:
netstandard.dll, System.Runtime.dll
Assembly:
System.Runtime.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
DictionaryEntry.cs
Source:
DictionaryEntry.cs
Source:
DictionaryEntry.cs
Source:
DictionaryEntry.cs
Source:
DictionaryEntry.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets or sets the value in the key/value pair.

public:
 property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };
public object Value { get; set; }
public object? Value { get; set; }
member this.Value : obj with get, set
Public Property Value As Object

Property Value

The value in the key/value pair.

Examples

The following example demonstrates the Value property. This code example is part of a larger example provided for the DictionaryEntry class.

public void Add(object key, object value)
{
 // Add the new key/value pair even if this key already exists in the dictionary.
 if (ItemsInUse == items.Length)
 throw new InvalidOperationException("The dictionary cannot hold any more items.");
 items[ItemsInUse++] = new DictionaryEntry(key, value);
}
Public Sub Add(ByVal key As Object, ByVal value As Object) Implements IDictionary.Add

 ' Add the new key/value pair even if this key already exists in the dictionary.
 If ItemsInUse = items.Length Then
 Throw New InvalidOperationException("The dictionary cannot hold any more items.")
 End If
 items(ItemsInUse) = New DictionaryEntry(key, value)
 ItemsInUse = ItemsInUse + 1
End Sub

Applies to


Feedback

Was this page helpful?