event SelectionChanged ()
Fired when the selection was changed.

 TypeDescription 

Use the SelectionChanged event to notify your application when the selection was changed. Use the SelDate and SelectDate properties to find the selected date(s). Use the SelDate if the SingleSel is True. Use the SelectDate  is the SingleSel is False. Use the FocusDate property to specify the date that has the focus.

The following sample shows how to print the selected date when the SingleSel is True:

Private Sub Calendar1_SelectionChanged()
    Debug.Print FormatDateTime(Calendar1.SelDate())
End Sub

The following sample prints the selected date(s) if the SingleSel is False, ( the control accepts multiple selection):

Private Sub Calendar1_SelectionChanged()
    Dim i As Long
    For i = 0 To Calendar1.SelCount() - 1
        Debug.Print FormatDateTime(Calendar1.SelectDate(i))
    Next
End Sub

Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.