property CalendarCombo.Value as Date
Retrieves or sets the browsed date. Ensures that the date is visible.

 TypeDescription 
   Date A date expression that indicates the selected date.  
The Value property ( default property of the control ) indicates the selected date. The Value property is identical with the SelDate property. The Date property specifies the date being browsed in the drop down portion of the control. Use the MaskOnEmpty property to specify the caption being displayed in the control's label when the SelDate property is empty. The SelectionChanged event is fired if the user changes the browsed date. Use the AllowCheckBox property to display a check box left to the date. Use the AllowCheckBox property to display a check box left to the date, so a date can be selected or not as follows, If the Value property is not zero, the check box is checked, else the checkbox is unchecked, and the labels shows grayed.

In VB/NET or C# you may need to use the Nothing, null or Date.FromOADate(0) to convert the 0 value to a null date. 

For instance,

The following VB sample set the SelDate property on empty, when the user presses the Delete key: ( displays an empty date )

Private Sub CalendarCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyDelete) Then
        CalendarCombo1.SelDate = 0
    End If
End Sub 

or

Private Sub CalendarCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyDelete) Then
        CalendarCombo1.Value = 0
    End If
End Sub

Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.