Spread Silverlight Documentation
ToBool Method


The value to be converted.
Convert value to bool.
Syntax
'Declaration
 
Public Shared Function ToBool( _
   ByVal value As System.Object _
) As System.Boolean
'Usage
 
Dim value As System.Object
Dim value As System.Boolean
 
value = CalcConvert.ToBool(value)
public static System.bool ToBool( 
   System.object value
)

Parameters

value
The value to be converted.

Return Value

A bool indicate the convert result.
Exceptions
ExceptionDescription
System.InvalidCastExceptionCan not convert value to bool
Remarks
If value is a null reference (Nothing in Visual Basic), return false. If value is double, return true only if value is not equals to 0d. If value is float, return true only if value is not equals to 0f. If value is decimal, return true only if value is not equals to 0m. If value is long, return true only if value is not equals to 0. If value is System.Int32, return true only if value is not equals to 0. If value is short, return true only if value is not equals to 0. If value is sbyte, return true only if value is not equals to 0. If value is ulong, return true only if value is not equals to 0. If value is uint, return true only if value is not equals to 0. If value is ushort, return true only if value is not equals to 0. If value is byte, return true only if value is not equals to 0. If value is DateTime, return true only if the OADate of value is not equals to 0. If value is TimeSpan, return true only if the TotalDays of value is not equals to 0.
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

CalcConvert Class
CalcConvert Members

 

 


Copyright © GrapeCity, inc. All rights reserved.