SetSelectedDate

Description

Selects a specified date.

Applies to

MonthCalendar control

Syntax

controlname.SetSelectedDate ( d )

Argument

Description

controlname

The name of the MonthCalendar control for which you want to set the selected date

d

A date value to be set as the date selected

Returns

Integer. Returns 0 for success and one of the following negative values otherwise:

Usage

Use the SetSelectedDate function to select a single date. SetSelectedDate returns -1 if you try to specify a date that is outside the range of minimum and maximum dates specified with SetDateLimits.

SetSelectedDate and SetSelectedRange trigger a DateChanged event. You should not call either method in a DateChanged event, paticularly using the Post method.

Examples

Example 1

This example sets the selected date to a date passed into a function:

// function argument seldate
integer li_return

li_return = mc_1.SetSelectedDate(seldate)

See also