Selects a range of dates (range selection only).
| C# | void object.SetRange(object StartDate, object EndDate); |
| VB.NET | object.SetRange(ByVal StartDate As Object, ByVal EndDate As Object) |
| C++ | HRESULT object->SetRange(const _variant_t& StartDate, const _variant_t& EndDate); |
| C | HRESULT object->raw_SetRange(VARIANT StartDate, VARIANT EndDate); |
object
StartDate
The first date of the range, or Null for none.
EndDate
The last date of the range, or Null for none.
The SetRange method selects a range of dates. It can only be used in range selection mode (SelectionMode set to selectionSftDateRange); otherwise it causes an error. p The first date of the range is also the value of the control (Value). The range is retrieved using the RangeStart and RangeEnd properties. Setting both dates in one call avoids an intermediate range that would be moved or refused. p A date field control shows both dates, separated by the RangeSeparator text, and keeps the time of each date. A range can have a first date without a last date. Null as StartDate empties the field (or clears its check box). p In a month calendar control, both dates are days (00:00:00). If StartDate is Null, the last date is used as the first date as well; if both are Null, no range is selected. p A range outside the limits defined by MinDate and MaxDate causes an error. Calendar.MaxRangeDays limits the user's selection only, not a range set using SetRange. p When the range changes, the control raises the RangeChanged event, and ValueChanged if the first date changed.
See Also SftCalendar Object | Object Hierarchy | Ranges