Expand Minimize

Type.GetEnumName Method

.NET Framework 4.6 and 4.5

Returns the name of the constant that has the specified value, for the current enumeration type.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Overridable Function GetEnumName ( _
	value As Object _
) As String

Parameters

value
Type: System.Object

The value whose name is to be retrieved.

Return Value

Type: System.String
The name of the member of the current enumeration type that has the specified value, or Nothing if no such constant is found.

ExceptionCondition
ArgumentException

The current type is not an enumeration.

-or-

value is neither of the current type nor does it have the same underlying type as the current type.

ArgumentNullException

value is Nothing.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft