Converts a Boolean to a UInt16.
[Visual Basic] Overridable Public Function ToUInt16() As UInt16 [C#] public virtual ushort ToUInt16(); [C++] public: virtual unsigned short ToUInt16(); [JScript] public function ToUInt16() : UInt16;
A number as a UInt16.
Exception Type | Condition |
---|---|
InvalidCastException | If it doesn't return a UInt16. |
The ToUInt16 method converts a Boolean value into a UInt16 and returns the Boolean value for this instance. True is converted to one, and false is converted to zero (see ToUInt16 for more information).
Boolean Structure | Boolean Members | System Namespace | Convert