Skip to content

AttachToCalendar Method

Description

Associates a DatePicker Control with a Calendar Control.

Syntax

Public Sub AttachToCalendar( _
    ByVal [Calendar](#) As [CalendarControl](XtremeCalendarControl~CalendarControl.md) _
)

Parameters

  • Calendar: Reference to a Calendar Control.

Remarks

The AttachToCalendar method provides a connection between a CalendarControl object and a DatePicker object.

The AttachToCalendar method provides synchronization facilities between the CalendarControl and DatePicker Control. It works as a "glue" between both controls and reflects changes on one of them to the corresponding changes on the second one. For example, if a date is clicked on in the DatePicker, then that day will become visible in the calendar.

Example

AttachToCalendar Sample (C#)

This sample illustrates how to synchronize the DatePicker with the CalendarControl. This sample assumes that the DatePicker Control is located on a form named DatePicker and the Calendar Control is located on a form called frmMain. The frmMain form has a Static Public variable named Instance that references the frmMain form.

private void InitializeDatePicker()  
{         
    XtremeCalendarControl.CalendarControl pCalendarOcx =   
        (XtremeCalendarControl.CalendarControl)(frmMain.Instance.CalendarControl.GetOcx());                             

    DatePicker.AttachToCalendar(pCalendarOcx);  
}

AttachToCalendar Sample (Visual Basic)

This sample illustrates how to synchronize the DatePicker with the CalendarControl. This sample assumes that the DatePicker Control is located on a form named DatePicker and the Calendar Control is located on a form called frmMain.

wndDatePicker.AttachToCalendar frmMain.wndCalendarControl

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.