SetSelectedRange
PowerScript function
Description
Sets the range of selected dates.
Applies to
MonthCalendar control
Syntax
|
1 |
controlname.SetSelectedRange ( start, end ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the MonthCalendar control for which you want |
|
start |
A date value to be set as the earliest date |
|
end |
A date value to be set as the latest date selected |
Return value
Integer.
Returns 0 for success and one of the following negative values
otherwise:
-1 — Invalid arguments
-2 — Unknown failure
Usage
Use the SetSelectedRange function to select a range of consecutive
dates.
SetSelectedRange uses the start date as the end date and vice versa
if you specify an end date that is earlier than the start date. You must
set the MaxSelectedCount property to a value large enough to support the
range before calling SetSelectedRange. SetSelectedRange returns -1 if the
dates you specify are outside the range of minimum and maximum dates
specified with SetDateLimits, or if the range exceeds MaxSelectedCount. If
the start and end dates are the same, a single date is selected.
If the user scrolls the calendar with the navigation buttons when a
date range is selected, the date range changes as the calendar
scrolls.
SetSelectedDate and SetSelectedRange trigger a DateChanged event.
You should not call either method in a DateChanged event, particularly
using the Post method.
Examples
This example sets the start date of the selected range to startdate
and the end date to enddate:
|
1 2 3 4 5 |
integer li_return Date startdate, enddate startdate = Today() enddate = Date("12-31-2007") li_return = mc_1.SetSelectedRange(startdate, enddate) |
See also