SetSelection Action (MonthCalendar Controls)

Applies to TestComplete 14.60, last modified on April 22, 2021

Description

Use the SetSelection action to select one or several dates in the month calendar control. If the control does not support multi-selection, the action selects only one date - the date specified by the First parameter. If the month calendar control supports multi-selection, SetSelection selects the specified range of dates in the calendar.

Declaration

TestObj.SetSelection(FirstLast)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
First [in]    Required    Date/Time    
Last [in]    Optional    Date/Time Default value:    
Result None

Applies To

The method is applied to the following object:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameters:

First

Specifies the first date of the range to be selected if the control supports multi-selection. Otherwise this parameter specifies the date to be selected.

Last

Specifies the last date of the range to be selected. If the control does not support multi-selection, Last is ignored.

Result Value

None.

Remarks

If Last is omitted, SetSelection modifies the selected range. After calling to SetSelection, wDate specifies the earliest date in the range, wEndDate - the latest date.

If First or Last is less than wMinDate or greater than wMaxDate, the selected range is not changed. The range is also not changed if the specified range is wider than the maximum range set for the control.

Example

To view an example that demonstrates how to use the SetSelection action, see Setting MonthCalendar Date.

See Also

Setting MonthCalendar Date
wDate Property (Calendar Controls)
wEndDate Property (MonthCalendar Controls)
wMaxDate Property (Calendar Controls)
wMinDate Property (Calendar Controls)
wMultiSelect Property (MonthCalendar Controls)

Highlight search results