Defines whether one date or a range of dates is selected.
Get
| C# | SftDateSelectionModeConstants Mode = object.SelectionMode; |
| VB.NET | Mode = object.SelectionMode As SftDateSelectionModeConstants |
| C++ | enum SftDateSelectionModeConstants Mode = object->SelectionMode; enum SftDateSelectionModeConstants Mode = object->GetSelectionMode(); |
| C | HRESULT object->get_SelectionMode(enum SftDateSelectionModeConstants* Mode); |
Put
| C# | SftDateSelectionModeConstants object.SelectionMode = Mode; |
| VB.NET | object.SelectionMode = Mode As SftDateSelectionModeConstants |
| C++ | enum SftDateSelectionModeConstants object->SelectionMode = Mode; void object->PutSelectionMode(enum SftDateSelectionModeConstants Mode); |
| C | HRESULT object->put_SelectionMode(enum SftDateSelectionModeConstants Mode); |
object
Mode
Defines whether one date or a range of dates is selected.
| Name | Value | Description |
|---|---|---|
| selectionSftDateSingle | 0 | One date |
| selectionSftDateRange | 1 | A range of dates |
The SelectionMode property defines whether the control selects one date or a range of dates. The default is selectionSftDateSingle. p In range selection mode, a month calendar control lets the user select a range of days, and a date field control shows and edits two dates, separated by the RangeSeparator text, with a dropdown calendar that selects a range. The Value property returns the first date of the range. The range is retrieved using the RangeStart and RangeEnd properties and set using the SetRange method. p Calendar.MaxRangeDays limits the number of days the user can select. The control raises the RangeChanged event when the selected range changes.
info.DateTimeFormat.Calendar = new JapaneseCalendar();
else if (culture.Calendar == SftDateCalendarTypeConstants.calendarSftDateHebrew)
info.DateTimeFormat.Calendar = new HebrewCalendar();
return date.ToString("D", info);
}
private void ShowSelection() {
string text = "Selected: (none)";
if (sftCalendar.SelectionMode == SftDateSelectionModeConstants.selectionSftDateRange) {
if (sftCalendar.RangeStart is DateTime) {
DateTime start = (DateTime)sftCalendar.RangeStart;
DateTime end = sftCalendar.RangeEnd is DateTime ? (DateTime)sftCalendar.RangeEnd : start;
text = "Selected: " + FormatLongDate(start) + " - " + FormatLongDate(end);
}
} else if (sftCalendar.Value is DateTime)
text = "Selected: " + FormatLongDate((DateTime)sftCalendar.Value);
ElseIf culture.Calendar = SftDateCalendarTypeConstants.calendarSftDateHebrew Then
info.DateTimeFormat.Calendar = New HebrewCalendar()
End If
Return value.ToString("D", info)
End Function
Private Sub ShowSelection()
Dim selection As String = "Selected: (none)"
If sftCalendar.SelectionMode = SftDateSelectionModeConstants.selectionSftDateRange Then
If TypeOf sftCalendar.RangeStart Is Date Then
Dim start As Date = CDate(sftCalendar.RangeStart)
Dim [end] As Date = If(TypeOf sftCalendar.RangeEnd Is Date, CDate(sftCalendar.RangeEnd), start)
selection = "Selected: " & FormatLongDate(start) & " - " & FormatLongDate([end])
End If
ElseIf TypeOf sftCalendar.Value Is Date Then
selection = "Selected: " & FormatLongDate(CDate(sftCalendar.Value))See Also SftCalendar Object | Object Hierarchy | Ranges