Type | Description | |||
Date | A DATE expression that indicates the selected date. |
Use the SelDate property to select a date while the SingleSel property is True. In this case, the date that has the focus is changed too. Use the FocusDate property to specify the date that has the focus. If the SingleSel property is False, Use the SelectDate and SelCount properties to enumerate the selected dates. The control fires the SelectionChanged event when the user selects a new date. Use the FirstVisibleDate property to get the first visible date. Use the LastVisibleDate property to get the last visible date.
The following VB sample prints the selected date(s):
With Calendar1 Dim i As Long For i = 0 To .SelCount - 1 Debug.Print FormatDateTime(.SelectDate(i), vbLongDate) Next End With
The following C++ sample prints the selected date(s):
for ( long i = 0 ; i < m_calendar.GetSelCount() ; i++ ) { COleDateTime date = m_calendar.GetSelDate(); OutputDebugString( date.Format() ); }
The following VB.NET sample prints the selected date(s):
With AxCalendar1 Dim i As Integer For i = 0 To .SelCount - 1 System.Diagnostics.Debug.WriteLine(.get_SelectDate(i).ToString()) Next End With
The following C# sample prints the selected date(s):
for (int i = 0; i < axCalendar1.SelCount; i++) System.Diagnostics.Debug.WriteLine(axCalendar1.get_SelectDate(0).ToString());
The following VFP sample prints the selected date(s):
with thisform.Calendar1 local i, d for i = 0 to .SelCount -1 d = .SelectDate(i) next endwith