Skip to content

AttachToCalendar Method

Description

Associates a CaptionBar Control with a Calendar Control.

Syntax

Public Sub AttachToCalendar( _
    ByVal Calendar As CalendarControl _
)

Parameters

  • Calendar: Reference to a Calendar Control.

Remarks

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

The AttachToCalendar method provides synchronization facilities between the CalendarControl and CaptionBar 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 view button such as the "Month" button is clicked on the CaptionBar, then that view will become visible in the calendar.

Example

CaptionBar Sample (C#)

This sample illustrates how to synchronize the CaptionBar with the CalendarControl. This sample assumes that the CaptionBar Control is located on a form named CaptionBar 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 InitializeCaptionBar()   
{           
    XtremeCalendarControl.CalendarControl pCalendarOcx =    
        (XtremeCalendarControl.CalendarControl)(frmMain.Instance.CalendarControl.GetOcx());                   

    CaptionBar.AttachToCalendar(pCalendarOcx);   
}

CaptionBar Sample (VB)

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

wndCaptionBar.AttachToCalendar frmMain.wndCalendarControl

See Also


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