Xceed Grid for WinForms v4.3 Documentation
TryParse Method (WinDatePicker)


Xceed.Editors.v2.6 Assembly > Xceed.Editors Namespace > WinDatePicker Class : TryParse Method
A string containing a date to parse.
A System.DateTime equivalent to the date contained in editText. If editText is empty, NullDate is returned.
Parses the specified string representation of a date and time to its DateTime equivalent
Syntax
'Declaration
 
Public Function TryParse( _
   ByVal editText As String, _
   ByRef parsedDate As Date _
) As Boolean
'Usage
 
Dim instance As WinDatePicker
Dim editText As String
Dim parsedDate As Date
Dim value As Boolean
 
value = instance.TryParse(editText, parsedDate)
public bool TryParse( 
   string editText,
   out DateTime parsedDate
)

Parameters

editText
A string containing a date to parse.
parsedDate
A System.DateTime equivalent to the date contained in editText. If editText is empty, NullDate is returned.

Return Value

true if editText was successfully parsed; false otherwise.
Remarks

The editText will be parsed according to the EditFormatProvider and the control's current DatePickerTextBoxArea.Mask.

This method ignores unrecognized data if possible and fills in missing month, day, and year information with the current time. Any leading, inner, or trailing white space character in editText is ignored.

text must contain the representation of a date in one of the formats described in the System.Globalization.DateTimeFormatInfo class topic in .NET Framework's documentation.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

WinDatePicker Class
WinDatePicker Members