Today we released weekly update to DotNetBar for WinForms and Schedule control includes very nice new functionality that I would like to show to you.

The CalendarView control has the ability to display any number of TimeIndicators in the Day, Week, and TimeLine views.  TimeIndicators are used to give feedback to the user as to either the current system time, or a user designated time.  Here is an example of what a set of 3 different TimeIndicators could look like (click image for full size image):

DotNetBar Time Indicator in Calendar/Schedule Control

The CalendarView control has a default TimeIndicator object available for your configuration and use.  You can also define as many as you need and add them to the CalendarView.TimeIndicators collection.  Each TimeIndicator object has the following properties available for user configuration:

IndicatorTime: A DateTime value that signifies the root starting display time for the Indicator.

  • IndicatorTimeOffset: A TimeSpan value that signifies a time offset from the set IndicatorTime.  The Indicator will be displayed at IndicatorTime plus IndicatorTimeOffset.
  • IndicatorArea: The display area designation, as defined by eTimeIndicatorArea.
    • eTimeIndicatorArea.Header:  The Indicator is displayed only in the associated Time Header (green example in above figure).
    • eTimeIndicatorArea.Content:  The Indicator is displayed only in the view Content area (pink example in above figure).
    • eTimeIndicatorArea.All:  The Indicator is displayed in both the Time Header and view Content area (gold example in above figure).
  • IndicatorSource:  Designates the source of the IndicatorTime, as defined by eTimeIndicatorSource.
    • eTimeIndicatorSource.SystemTime:  IndicatorTime is updated by the System time at 1 minute intervals (if enabled, see below).
    • eTimeIndicatorSource.UserSpecified:  IndicatorTime is specified and maintained by the user.
  • Visibility:  Designates the Indicator’s visibility, as defined by eTimeIndicatorVisibility.
    • eTimeIndicatorVisibility.AllResources:  Indicator is displayed on all available views (gold example in above figure).
    • eTimeIndicatorVisibility.SelectedResources:  Indicator is displayed only on the currently selected view (pink example in above figure).
    • eTimeIndicatorVisibility.Hidden:  Indicator is hidden (default).
  • BorderColor:  Designates the leading edge border color.
  • IndicatorColor:  Designates the Gradient color of the Indicator.
  • Thickness:  Designates the thickness of the Indicator (default is 4).
  • Enabled:  Indicates whether automatic IndicatorTime updates are enabled (only utilized when IndicatorSource is SystemTime).

To utilize the default CalendarView TimeIndicator, you need only access it via CalendarView.TimeIndicator.  All you need do is to set the initial IndicatorTime and its Visibility to either AllResources or SelectedResources.

CalendarView.TimeIndicator.IndicatorTime =  DateTime.Now;
CalendarView.TimeIndicator.Visibility =  eTimeIndicatorVisibility.AllResources;

Here are code examples showing how to create the pink and green TimeIndicators as shown in the above figure:

TimeIndicator ti = new TimeIndicator();
ti.Thickness  = 10;
ti.IndicatorTimeOffset = new TimeSpan(2, 15, 0);
ti.BorderColor  = Color.Green;
ti.IndicatorColor = new ColorDef(new Color[] {  Color.Empty,
                    Color.GreenYellow, Color.Green },
                    new float[] { 0f, .5f, 1f  });
ti.Visibility = eTimeIndicatorVisibility.AllResource;
ti.IndicatorArea  = eTimeIndicatorArea.Header;
ti  = new TimeIndicator();
ti.Thickness = 20;
ti.IndicatorTimeOffset  = new TimeSpan(-2, 15, 0);
ti.BorderColor = Color.HotPink;
ti.IndicatorColor  = new ColorDef(Color.Empty, Color.Pink);
ti.Visibility =  eTimeIndicatorVisibility.SelectedResource;
ti.IndicatorArea =  eTimeIndicatorArea.Content;

TimeIndicators can be as subtle or as “daring” as you like:

DotNetBar Calendar/Schedule control time-marker, indicator custom appearance

The above was created with the following code:

ti = new TimeIndicator();
ti.Thickness = 40;
ti.BorderColor  = Color.MidnightBlue;
ti.IndicatorColor = new ColorDef(new Color[]
                    {  Color.Empty, Color.AliceBlue,
                    Color.DeepSkyBlue, Color.DarkSlateBlue },
                    new float[] { 0f, .15f, .55f, 1f });
ti.IndicatorArea =  eTimeIndicatorArea.Content;
ti.Visibility =  eTimeIndicatorVisibility.AllResources;

This covers the new time-marker functionality in our schedule control. Hope you find it useful. Stay tuned for more.

Professional looking applications made easy with DotNetBar for WinForms, Silverlight and WPF User Interface components. Click here to find out more.