Returns an instance of the given enumeration type set to the given value.
[Visual Basic] Overloads Public Shared Function ToObject( _ ByVal enumType As Type, _ ByVal value As Long _ ) As Object [C#] public static object ToObject( Type enumType, long value ); [C++] public: static Object* ToObject( Type* enumType, __int64 value ); [JScript] public static function ToObject( enumType : Type, value : long ) : Object;
An instance of the enumeration set to the given value.
Exception Type | Condition |
---|---|
ArgumentNullException | The enumType parameter is a null reference (in Visual Basic Nothing). |
ArgumentException | The enumType parameter is not an Enum type. |
Enum Class | Enum Members | System Namespace | Enum.ToObject Overload List