Articles in this section
Category / Section

How to customize the appointments label color in WinForms ScheduleControl?

1 min read

Customize the appointments label color

In order to customize the label color of the appointments, Initlists and GetLabels methods can be customized in custom WinForms Schedule Data Provider class. In InitLists method, required number of labels can be added with different colors.

C#

public class SimpleScheduleDataProvider : ScheduleDataProvider
{   
    public override ILookUpObjectList GetLabels()
    {
        return list;
    }   
    public override void InitLists()
    {
        list = new ListObjectList();
        list.Add(new ListObject(0, "None", Color.Black));
        list.Add(new ListObject(1, "Important", Color.Red));
        list.Add(new ListObject(2, "Business", Color.Purple));
        list.Add(new ListObject(3, "Personal", Color.Tomato));
        list.Add(new ListObject(4, "Vacation", Color.Pink));
        list.Add(new ListObject(5, "Must Attend", Color.YellowGreen));
        list.Add(new ListObject(6, "Travel Required", Color.Violet));
        list.Add(new ListObject(7, "Needs Preparation", Color.Tomato));
        list.Add(new ListObject(8, "Birthday", Color.SpringGreen));
        list.Add(new ListObject(9, "Anniversary", Color.DarkMagenta));
        list.Add(new ListObject(10, "Phone Call", Color.RosyBrown));
        list.Add(new ListObject(11, "Marriage", Color.Aqua));
    }
}

 

VB

Public Class SimpleScheduleDataProvider
    Inherits ScheduleDataProvider
    Public Overrides Function GetLabels() As ILookUpObjectList
        Return list
    End Function
    Public Overrides Sub InitLists()
        list = New ListObjectList()
        list.Add(New ListObject(0, "None", Color.Black))
        list.Add(New ListObject(1, "Important", Color.Red))
        list.Add(New ListObject(2, "Business", Color.Purple))
        list.Add(New ListObject(3, "Personal", Color.Tomato))
        list.Add(New ListObject(4, "Vacation", Color.Pink))
        list.Add(New ListObject(5, "Must Attend", Color.YellowGreen))
        list.Add(New ListObject(6, "Travel Required", Color.Violet))
        list.Add(New ListObject(7, "Needs Preparation", Color.Tomato))
        list.Add(New ListObject(8, "Birthday", Color.SpringGreen))
        list.Add(New ListObject(9, "Anniversary", Color.DarkMagenta))
        list.Add(New ListObject(10, "Phone Call", Color.RosyBrown))
        list.Add(New ListObject(11, "Marriage", Color.Aqua))
    End Sub

Screenshot:

Customize the appointments label color

Samples:

C#: Customizing Labelcolor_CS

VB: Customizing Labelcolor_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied