Skip to content

CalendarGetItemTextParams Object

See Also

CalendarGetItemTextParams Members | AskItemTextFlags Property | GetItemText Event | XTPCalendarGetItemText Enumeration | XTPCalendarGetItemTextEx Enumeration | SetFlag Method | IsFlagSet Method | ResetFlag Method | Item Property | Text Property | ViewDay Property | ViewEvent Property | WeekDay Property

See Also


Description

The CalendarGetItemTextParams object is used with the GetItemText event. It contains the Text, ViewDay, ViewEvent, and WeekDay properties of a calendar item that is about to be drawn.

For a list of all members defined in this module, see CalendarGetItemTextParams Members.


Object Model

Object Model
Parent ViewEvent
Child ViewDay


Remarks

The CalendarGetItemTextParams object is utilized in the GetItemText event and contains the properties Text, ViewDay, ViewEvent, and WeekDay of a calendar item that is about to be drawn. Note that some of these properties might be NULL depending on which component is about to be drawn.

The Text property of the CalendarGetItemTextParams object is used to set a custom value for the text of a calendar item that is about to be drawn in the GetItemText event.

The SetFlag method uses any combination of flags from the XTPCalendarGetItemText and XTPCalendarGetItemTextEx enumerations to specify for which calendar text strings the GetItemText event will be triggered. The event occurs when each calendar text string is about to be drawn if some Flags from the enumerations have been set using the SetFlag method.

If you want the GetItemText event to be triggered for all flags in the XTPCalendarGetItemText and XTPCalendarGetItemTextEx enumerations, simply set AskItemTextFlags to -1. This will cause the GetItemText event to fire before each text string is drawn in the calendar.

This allows all strings in the calendar to be easily customized. For example, the day header text and time scale text can be customized. The Text property of the Params parameter contains the text that is about to be drawn and can be set to any customized text.


Example

GetItemText Sample (Visual Basic)

This sample illustrates how to customize calendar text.

Private Sub Form_Load()  
    ' can use -1 to set all flags. Like:  
    CalendarControl.AskItemTextFlags = -1  

    ' or use separate flags as:  
    CalendarControl.AskItemTextFlags.SetFlag xtpCalendarItemText_EventSubject  
    CalendarControl.AskItemTextFlags.SetFlag xtpCalendarItemText_EventLocation  
End Sub  

Private Sub CalendarControl_GetItemText(ByVal Params As XtremeCalendarControl.CalendarGetItemTextParams)  
    If Params.Item = xtpCalendarItemText_EventSubject Then  
        Params.Text = "*Custom subject* " & Params.Text  
    ElseIf Params.Item = xtpCalendarItemText_EventLocation Then  
        Params.Text = "ScheduleID = " & Params.ViewEvent.Event.ScheduleID  
    ElseIf Params.Item = xtpCalendarItemText_EventBody Then  
        Params.Text = "custom BODY text."  
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeader Or _  
           Params.Item = xtpCalendarItemText_WeekViewDayHeader Or _  
           Params.Item = xtpCalendarItemText_MonthViewDayHeader Then  
        Params.Text = "Date:" & Params.ViewDay.Date  
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeaderLeft Or _  
           Params.Item = xtpCalendarItemText_WeekViewDayHeaderLeft Or _  
           Params.Item = xtpCalendarItemText_MonthViewDayHeaderLeft Then  
        Params.Text = Day(Params.ViewDay.Date)  
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeaderCenter Or _  
           Params.Item = xtpCalendarItemText_WeekViewDayHeaderCenter Or _  
           Params.Item = xtpCalendarItemText_MonthViewDayHeaderCenter Then  
        Params.Text = WeekdayName(Weekday(Params.ViewDay.Date), , vbSunday)  
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeaderRight Or _  
           Params.Item = xtpCalendarItemText_WeekViewDayHeaderRight Or _  
           Params.Item = xtpCalendarItemText_MonthViewDayHeaderRight Then  
        Params.Text = Year(Params.ViewDay.Date)  
    ElseIf Params.Item = xtpCalendarItemText_MonthViewWeekDayHeader Then  
        Params.Text = Params.Text & " - " & Params.Weekday  
    ElseIf Params.Item = xtpCalendarItemText_EventToolTipText Then  
        Params.Text = "(" & Params.ViewEvent.Event.Location & ") " & _  
                      Params.ViewEvent.Event.Subject & _  
                      " [" & Params.ViewEvent.Event.Id & "]"  
    End If  
End Sub

See Also

CalendarGetItemTextParams Members | AskItemTextFlags Property | GetItemText Event | XTPCalendarGetItemText Enumeration | XTPCalendarGetItemTextEx Enumeration | SetFlag Method | IsFlagSet Method | ResetFlag Method | Item Property | Text Property | ViewDay Property | ViewEvent Property | WeekDay Property


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