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 Short _ ) As Object [C#] public static object ToObject( Type enumType, short value ); [C++] public: static Object* ToObject( Type* enumType, short value ); [JScript] public static function ToObject( enumType : Type, value : Int16 ) : 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