Back to Devexpress

Time Ruler

windowsforms-1737-controls-and-libraries-scheduler-visual-elements-scheduler-control-time-ruler.md

latest4.0 KB
Original Source

Time Ruler

  • Apr 23, 2018
  • 2 minutes to read

Time rulers are used to indicate time intervals in the Day View, Work-Week View and Full Week View.Views views. A view can display several time rulers at the same time. A time ruler corresponds to the TimeRuler class. Time rulers of a view are accessible using the DayView.TimeRulers property.

A time ruler can show the following elements.

The image below illustrates a Day View displaying three time rulers with different settings.

The following table lists several properties that affect time ruler appearance.

|

Appearance

|

The DayViewAppearance.TimeRuler, DayViewAppearance.TimeRulerHourLine, DayViewAppearance.TimeRulerLine, DayViewAppearance.TimeRulerNowArea, DayViewAppearance.TimeRulerNowLine properties specify the appearance settings used to paint a time ruler. If a scheduler control is painted in the WindowsXP or Skin style, the appearance settings used to paint the time rulers are ignored.

| |

Location

|

The TimeRuler.HorizontalAlignment property specifies whether the Time ruler is displayed on the left (default for Left-to-Right layout) or on the right side of the view.

| |

Formatting Services

|

The ITimeRulerFormatStringService interface enables you to custom format the text of time labels within the Time Ruler.

| |

Custom Draw Event

|

SchedulerControl.CustomDrawDayViewTimeRuler. Handle this event to take over the control’s painting process, changing elements of appearance that are not available using properties.

| |

Time Zone Support

|

Use the TimeRuler.TimeZoneId property to specify the time zone for which the time is displayed. The TimeRuler.UseClientTimeZone property specifies that the time zone of the Time ruler follows the time zone of the Scheduler.

|