property Calendar.SelectDate(Date as Date) as Boolean
Selects or unselects a date in the calendar panel.

TypeDescription
Date as Date A DATE expression to be selected or unselected
Boolean A Boolean expression that specifies whether the date is selected ( True ) or unselected ( False )
The SelectDate property can be used to programmatically select or unselect the giving date. An alternative to SelectDate is using the Selection that can uses an expression to indicate the dates to be selected. The Selection = "0" unselects all dates in the calendar panel. The Select method can be used to select by code the current month, current week, current week day and the current/focus day.

The SelCount property counts the dates being selected in the calendar panel. The SingleSel property indicates whether the user can select one or multiple dates. If the SingleSel property is True, the SelCount property always returns 1. The SelDate property can be used to get the selected date giving its index in the selection dates collection. The AllowSelectDate property indicates the keys combination so the user can select new dates in the calendar panel, and so, new dates to be shown in the schedule view. Once the user starts selecting a new date in the calendar panel, the control fires the LayoutStartChanging(exCalendarSelectionChange). Once a new date is selected, the LayoutEndChanging(exCalendarSelectionChange) event occurs. The DateFromPoint property indicates the date in the calendar panel from the cursor.

The following samples shows how programmatically you can select a single date:

VBA (MS Access, Excell...)

With Schedule1
	With .Calendar
		.Selection = "0"
		.SelectDate(#1/1/2012#) = True
	End With
End With

VB6

With Schedule1
	With .Calendar
		.Selection = "0"
		.SelectDate(#1/1/2012#) = True
	End With
End With

VB.NET

With Exschedule1
	With .Calendar
		.Selection = "0"
		.set_SelectDate(#1/1/2012#,True)
	End With
End With

VB.NET for /COM

With AxSchedule1
	With .Calendar
		.Selection = "0"
		.SelectDate(#1/1/2012#) = True
	End With
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSCHEDULELib' for the library: 'ExSchedule 1.0 Control Library'

	#import <ExSchedule.dll>
	using namespace EXSCHEDULELib;
*/
EXSCHEDULELib::ISchedulePtr spSchedule1 = GetDlgItem(IDC_SCHEDULE1)->GetControlUnknown();
EXSCHEDULELib::ICalendarPtr var_Calendar = spSchedule1->GetCalendar();
	var_Calendar->PutSelection("0");
	var_Calendar->PutSelectDate("1/1/2012",VARIANT_TRUE);

C++ Builder

Exschedulelib_tlb::ICalendarPtr var_Calendar = Schedule1->Calendar;
	var_Calendar->set_Selection(TVariant("0"));
	var_Calendar->set_SelectDate(TDateTime(2012,1,1).operator double(),true);

C#

exontrol.EXSCHEDULELib.Calendar var_Calendar = exschedule1.Calendar;
	var_Calendar.Selection = "0";
	var_Calendar.set_SelectDate(Convert.ToDateTime("1/1/2012",System.Globalization.CultureInfo.GetCultureInfo("en-US")),true);

JavaScript

<OBJECT classid="clsid:9B09E13D-7A88-4299-9DBE-383380435377" id="Schedule1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	var var_Calendar = Schedule1.Calendar;
		var_Calendar.Selection = "0";
		var_Calendar.SelectDate("1/1/2012") = true;
</SCRIPT>

C# for /COM

EXSCHEDULELib.Calendar var_Calendar = axSchedule1.Calendar;
	var_Calendar.Selection = "0";
	var_Calendar.set_SelectDate(Convert.ToDateTime("1/1/2012",System.Globalization.CultureInfo.GetCultureInfo("en-US")),true);

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Calendar;
	anytype var_Calendar;
	;

	super();

	var_Calendar = exschedule1.Calendar(); com_Calendar = var_Calendar;
		com_Calendar.Selection("0");
		com_Calendar.SelectDate(str2Date("1/1/2012",213),true);
}

Delphi 8 (.NET only)

with AxSchedule1 do
begin
	with Calendar do
	begin
		Selection := '0';
		SelectDate['1/1/2012'] := True;
	end;
end

Delphi (standard)

with Schedule1 do
begin
	with Calendar do
	begin
		Selection := '0';
		SelectDate['1/1/2012'] := True;
	end;
end

VFP

with thisform.Schedule1
	with .Calendar
		.Selection = "0"
		.SelectDate({^2012-1-1}) = .T.
	endwith
endwith

dBASE Plus

local oSchedule,var_Calendar

oSchedule = form.Activex1.nativeObject
var_Calendar = oSchedule.Calendar
	var_Calendar.Selection = "0"
	// var_Calendar.SelectDate("01/01/2012") = true
	with (oSchedule)
		TemplateDef = [Dim var_Calendar]
		TemplateDef = var_Calendar
		Template = [var_Calendar.SelectDate("01/01/2012") = true]
	endwith

XBasic (Alpha Five)

Dim oSchedule as P
Dim var_Calendar as P

oSchedule = topparent:CONTROL_ACTIVEX1.activex
var_Calendar = oSchedule.Calendar
	var_Calendar.Selection = "0"
	' var_Calendar.SelectDate({01/01/2012}) = .t.
	oSchedule.TemplateDef = "Dim var_Calendar"
	oSchedule.TemplateDef = var_Calendar
	oSchedule.Template = "var_Calendar.SelectDate(#01/01/2012#) = True"


Visual Objects

local var_Calendar as ICalendar

var_Calendar := oDCOCX_Exontrol1:Calendar
	var_Calendar:Selection := "0"
	var_Calendar:[SelectDate,SToD("20120101")] := true

PowerBuilder

OleObject oSchedule,var_Calendar

oSchedule = ole_1.Object
var_Calendar = oSchedule.Calendar
	var_Calendar.Selection = "0"
	var_Calendar.SelectDate(2012-01-01,true)