Articles in this section

How to change the label of the appointments in the calendar of WinForms Schedulecontrol?

Change the label of appointments


In WinForms ScheduleControl  to change the label of appointment, ParseDisplayItem event can be used. In that event, label of that appointment can be customized by using e.FormattedText property.


C#

//Event Triggering.
this.scheduleControl1.ParseDisplayItem += new ParseDisplayItemEventHandler(this.scheduleControl1_ParseDisplayItem);

//Event Handling.
private void scheduleControl1_ParseDisplayItem(object sender, ParseDisplayItemEventArgs e)
{
    e.Item.Subject = "Title";
    e.FormattedText = e.Item.StartTime.Hour + ":" + ((System.Convert.ToString(e.Item.StartTime.Minute).Length == 1) ? "0": "") + e.Item.StartTime.Minute + " --> " + e.Item.Subject;  
    e.Handled = true;
}

VB

'Event triggering.
AddHandler scheduleControl1.ParseDisplayItem, AddressOf scheduleControl1_ParseDisplayItem

'Event Handling
Private Sub scheduleControl1_ParseDisplayItem(ByVal sender As Object, ByVal e As ParseDisplayItemEventArgs)
    e.Item.Subject = "Title"
    e.FormattedText = e.Item.StartTime.Hour & ":" & (If((System.Convert.ToString(e.Item.StartTime.Minute).Length = 1), "0", "")) +    e.Item.StartTime.Minute & " --> " & e.Item.Subject
    e.Handled = True
End Sub

Customizing the appointment label as shown in the screenshot below

Change the label of appointments in the calendar


Samples:

C#: Customizing Appointmentlabel_CS

VB: Customizing Appointmentlabel_VB

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied